[Home]

Summary:ASTERISK-19971: Segfault in realtime_multi_ldap (possible invalid arguments)
Reporter:Lars Peter Thomsen (lapeth)Labels:
Date Opened:2012-06-07 07:03:29Date Closed:2012-08-29 08:58:51
Priority:MajorRegression?No
Status:Closed/CompleteComponents:
Versions:1.8.11.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 10.04 64-bitAttachments:( 0) debug_asterisk_gdb.txt
( 1) debug_asterisk_gdb2.txt
( 2) debug_asterisk_valgrind.txt
Description:Realtime LDAP module kills asterisk with a segfault when querying for extensions. It appears to happen in the realtime_multi_ldap function in res_config_ldap.c, where the newparam variable somehow is invalid (null or garbage). The warning in checking the variable is fired in several runs prior to the fault.

Calls go through every time before the fault, with the aforementioned warning being fired each time, and on the 8th to 10th attempt, the segfault occurs.

Disabling realtime extensions in extconfig.conf, so only users, peers and voicemail data is fetched from LDAP, while extensions are fetched from extensions.conf, causes the problem to not occur.

Entry in extconfig.conf:
extensions => ldap,"ou=extensions,dc=communica,dc=cabo,dc=dk",extensions

Entry in res_ldap.conf:
; Extensions Table
[extensions]
context = AstContext
exten = AstExtension
priority = AstPriority
app = AstApplication
appdata = AstApplicationData
additionalFilter=(objectClass=AsteriskExtension)
Comments:By: Lars Peter Thomsen (lapeth) 2012-06-07 08:12:08.845-0500

Now, it may be entirely possible that the config files have errors, but even if that's the case, it shouldn't result in a segfault.

By: Matt Jordan (mjordan) 2012-06-14 09:29:48.371-0500

Although the valgrind output points to the culprit, would you mind producing a backtrace as well?  That should clarify very quickly exactly where the seg fault happens and what is to blame.

Instructions here:

https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

By: Lars Peter Thomsen (lapeth) 2012-07-25 07:18:46.866-0500

I solved the issue by updating the config files, thus sidestepping the segfault. Now I'm trying to recreate the situation where the segfault occurs. It may take a while, as other issues get in the way. I'll update the bug when I have more.

By: Matt Jordan (mjordan) 2012-08-29 08:58:40.633-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines