[Home]

Summary:ASTERISK-13912: [patch] undefined symbols - modules can't be loaded
Reporter:pj (pj)Labels:
Date Opened:2009-04-07 10:49:30Date Closed:2009-05-18 15:55:18
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090411__bug14846.diff.txt
( 1) 20090413__bug14846__1.4.diff.txt
( 2) 20090507__issue14846__1.6.0.diff.txt
( 3) 20090507__issue14846__1.6.1.diff.txt
( 4) compile-fail.txt
( 5) patch.diff
Description:After updating from
Asterisk SVN-branch-1.6.1-r175257
to
Asterisk SVN-branch-1.6.1-r186622
some modules can't be loaded
compiled with
--->  Compiler Flags
[*] DONT_OPTIMIZE
[*] DEBUG_THREADS
[*] LOADABLE_MODULES
[*] DEBUG_CHANNEL_LOCKS
[*] MALLOC_DEBUG



****** ADDITIONAL INFORMATION ******

[Apr  7 17:40:19] WARNING[6021] loader.c: Error loading module 'app_queue.so': /usr/lib/asterisk/modules/app_queue.so: undefined symbol: ast_monitor_start
[Apr  7 17:40:19] WARNING[6021] loader.c: Module 'app_queue.so' could not be loaded.
[Apr  7 17:40:20] WARNING[6021] loader.c: Error loading module 'app_voicemail.so': /usr/lib/asterisk/modules/app_voicemail.so: undefined symbol: ast_smdi_interface_find
[Apr  7 17:40:20] WARNING[6021] loader.c: Module 'app_voicemail.so' could not be loaded.
Comments:By: Mark Michelson (mmichelson) 2009-04-07 17:04:02

Do you use the menuselect interface when upgrading? Menuselect has dependencies built into it so that if you attempt to build app_queue, res_monitor will also be built. Similarly, if you attempt to build app_voicemail, res_smdi will  be built, too.

By: pj (pj) 2009-04-08 01:17:28

yes, I'm always using menuselect, except for setting compiler flags, as wrote above, I also selected codec ilbc, all other leave in default.
now I checked if app_queue and app_voicemail was selected, res_monitor and res_smdi are also selected.



By: Tony Plack (plack) 2009-04-10 20:16:17

The issue is a new requirement in app_voicemail for SMDI.  If you have nothing configured in smdi.conf or no file, this error occurs because res_smdi.so will not load.

Also occurring in branches/1.4 r188019



By: Tony Plack (plack) 2009-04-10 21:42:42

Going back far enough (not sure the exact change because svn view is down... /gripe)

--- res/res_smdi.c (revision 122992)
+++ res/res_smdi.c (working copy)
@@ -1265,7 +1265,7 @@
return_error:
ast_module_user_remove(u);

- return 0;
+ return res;
}

If you change it from "return res" to "return 0" app_voicemail will work.  Looks like the correct response should have been res, but because the documentation didn't indicate why we had a "return 0", someone corrected it and broke the voicemail app.  We are doing a "return 0" here because we need res_smdi.so loaded even if we don't have any interfaces, just to make things work.

The only place this is referenced in app_voicemail.c is at 3937 (188019 in branches 1.4)

ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);

Will let the code warriors on this one figure this out.

By: Tony Plack (plack) 2009-04-10 22:19:45

Found the rev change, not able to see the log for this though

r188019 is the change point

By: Tilghman Lesher (tilghman) 2009-04-11 09:39:57

AST_OPTIONAL_API is one option for this.  We can define the symbols weakly, then check to see if they're available before using them.

By: Tilghman Lesher (tilghman) 2009-04-11 09:54:27

Patch uploaded.  This removes the dependency of app_voicemail on res_smdi, making res_smdi truly optional.

By: pj (pj) 2009-04-11 12:12:14

after applying your patch to 1.6.1 branch revison 188019 it failed to compile, errors attached in file compile-fail.txt

By: Tony Plack (plack) 2009-04-11 15:14:22

include/asterisk/optional_api.h is missing from svn.

Is this going to backport to branch/1.4?

By: Tony Plack (plack) 2009-04-12 11:53:48

optional_api.h is in trunk

By: Tilghman Lesher (tilghman) 2009-04-12 22:37:34

No, optional_api.h will not be backported to 1.4.  The earliest it will show up will be in 1.6.2.

By: Tilghman Lesher (tilghman) 2009-04-12 22:39:10

plack:  we can probably add your patch for versions 1.4 up to 1.6.1, as a workaround, then do the optional_api thing in 1.6.2 and trunk.

By: Tony Plack (plack) 2009-04-13 11:04:15

tilghman: That is okay, uploaded the patch file for completeness.  We will have to deal with some warning errors as res_smdi loads with no interfaces and some may have this module on a noload in the config (1 server of mine), but it should work.

Are you going to apply this to the branches?

By: pj (pj) 2009-04-13 11:52:45

so best way to overcome this issue is to upgrade from 1.6.1 branch to 1.6.2 branch? is patch solving this already commited into 1.6.2 branch?

By: Tony Plack (plack) 2009-04-13 11:58:24

pj: the patch I submitted just reverts previous behavior.  If there are not SMDI interfaces, the module would alway produce an error, but would not unload.

tilghman is correct that the best way to permanently fix this issue (that was attempted by the original change) is to make it optional.

It does appear that 1.6.2 and trunk both have his changes.

The question becomes if you can live with the old behavior (prior to r188019) or not.

By: pj (pj) 2009-04-13 12:05:10

currently I'm using Asterisk SVN-branch-1.6.1-r175257
that works fine
I would like to update to newer version, so, I tried
Asterisk SVN-branch-1.6.1-r186622
and it failed to load (I created this bugreport for this)
I'm not using smdi at all, I have no config for this
so, should I upgrade to 1.6.2?
Contains this 1.6.2 branch already tilghman's patch 20090411__bug14846.diff.txt?

By: Tilghman Lesher (tilghman) 2009-04-13 12:23:00

thought a bit more about it, and perhaps we should do the same for SMDI as we already do for ADSI (also a dependency).  Candidate patch for 1.4 uploaded.

By: Tilghman Lesher (tilghman) 2009-04-13 12:24:45

BTW, no branch yet has any of these modifications.

By: pj (pj) 2009-04-24 04:41:14

please change status of this bugreport from "ready for testing", that someone can continue solving this issue...
it was already tested but after patching 1.6.1 branch with supplied patch it failed to compile. thanks

By: Tilghman Lesher (tilghman) 2009-04-24 09:07:59

pj: the candidate patch is for 1.4, not 1.6.1.

By: pj (pj) 2009-04-24 09:20:23

ok, but this issue is about 1.6.1 branch, will be there some patch for this?

By: Leif Madsen (lmadsen) 2009-05-08 12:20:01

There are now 1.6.0, and 1.6.1 patches available for testing.

By: Leif Madsen (lmadsen) 2009-05-08 13:17:42

I can't reproduce this on my CentOS 5.2 development virtual machine. This must be something specific on your system, so you'll have to be the one to test this.

By: Leif Madsen (lmadsen) 2009-05-08 13:22:18

Nevermind, Tilghman clued me in how to reproduce. I didn't read the description quite closely enough.

By: Leif Madsen (lmadsen) 2009-05-08 13:26:18

Works for me!(tm)

By: pj (pj) 2009-05-10 15:45:43

It works for me also, thanks!
tested:
Asterisk SVN-branch-1.6.1-r193389 + 20090507__issue14846__1.6.1.diff.txt

By: Digium Subversion (svnbot) 2009-05-18 15:24:14

Repository: asterisk
Revision: 195366

U   branches/1.4/apps/app_voicemail.c
U   branches/1.4/res/res_smdi.c

------------------------------------------------------------------------
r195366 | tilghman | 2009-05-18 15:24:14 -0500 (Mon, 18 May 2009) | 8 lines

Add a similar dependency on SMDI for voicemail as already exists for ADSI.
(closes issue ASTERISK-13912)
Reported by: pj
Patches:
      20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
      20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
      20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=195366

By: Digium Subversion (svnbot) 2009-05-18 15:52:34

Repository: asterisk
Revision: 195370

_U  trunk/
U   trunk/apps/app_queue.c
U   trunk/apps/app_voicemail.c
U   trunk/include/asterisk/monitor.h
U   trunk/include/asterisk/smdi.h
U   trunk/res/res_monitor.c
U   trunk/res/res_smdi.c

------------------------------------------------------------------------
r195370 | tilghman | 2009-05-18 15:52:34 -0500 (Mon, 18 May 2009) | 15 lines

Recorded merge of revisions 195366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
 
 Add a similar dependency on SMDI for voicemail as already exists for ADSI.
 (closes issue ASTERISK-13912)
  Reported by: pj
  Patches:
        20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
        20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
        20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=195370

By: Digium Subversion (svnbot) 2009-05-18 15:53:38

Repository: asterisk
Revision: 195371

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_queue.c
U   branches/1.6.0/apps/app_voicemail.c
U   branches/1.6.0/include/asterisk/monitor.h
U   branches/1.6.0/include/asterisk/smdi.h
U   branches/1.6.0/res/res_smdi.c

------------------------------------------------------------------------
r195371 | tilghman | 2009-05-18 15:53:37 -0500 (Mon, 18 May 2009) | 22 lines

Recorded merge of revisions 195370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r195370 | tilghman | 2009-05-18 15:52:33 -0500 (Mon, 18 May 2009) | 15 lines
 
 Recorded merge of revisions 195366 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
   
   Add a similar dependency on SMDI for voicemail as already exists for ADSI.
   (closes issue ASTERISK-13912)
    Reported by: pj
    Patches:
          20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=195371

By: Digium Subversion (svnbot) 2009-05-18 15:54:30

Repository: asterisk
Revision: 195372

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_queue.c
U   branches/1.6.1/apps/app_voicemail.c
U   branches/1.6.1/include/asterisk/monitor.h
U   branches/1.6.1/include/asterisk/smdi.h
U   branches/1.6.1/res/res_smdi.c

------------------------------------------------------------------------
r195372 | tilghman | 2009-05-18 15:54:30 -0500 (Mon, 18 May 2009) | 22 lines

Recorded merge of revisions 195370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r195370 | tilghman | 2009-05-18 15:52:33 -0500 (Mon, 18 May 2009) | 15 lines
 
 Recorded merge of revisions 195366 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
   
   Add a similar dependency on SMDI for voicemail as already exists for ADSI.
   (closes issue ASTERISK-13912)
    Reported by: pj
    Patches:
          20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=195372

By: Digium Subversion (svnbot) 2009-05-18 15:55:16

Repository: asterisk
Revision: 195373

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_queue.c
U   branches/1.6.2/apps/app_voicemail.c
U   branches/1.6.2/include/asterisk/monitor.h
U   branches/1.6.2/include/asterisk/smdi.h
U   branches/1.6.2/res/res_monitor.c
U   branches/1.6.2/res/res_smdi.c

------------------------------------------------------------------------
r195373 | tilghman | 2009-05-18 15:55:16 -0500 (Mon, 18 May 2009) | 22 lines

Merged revisions 195370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r195370 | tilghman | 2009-05-18 15:52:33 -0500 (Mon, 18 May 2009) | 15 lines
 
 Recorded merge of revisions 195366 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
   
   Add a similar dependency on SMDI for voicemail as already exists for ADSI.
   (closes issue ASTERISK-13912)
    Reported by: pj
    Patches:
          20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
          20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=195373