Summary:ASTERISK-18092: asterisk segfault libpthread-2.9.so
Reporter:agustina (agustina)Labels:
Date Opened:2011-07-06 09:30:21Date Closed:2011-09-15 07:53:26
Versions:Frequency of
causesASTERISK-19285 [regression] Deadlock in asterisk (possible chan_agent and queues interaction)
Environment:Fedora 10Attachments:( 0) backtrace1.txt
( 1) backtrace2.txt
( 2) chan_agent.patch
Description:We have running a call center with asterisk and once or twice a day, the agents log out and the asterisk is restarted.
We get the following message in /var/log/messages:

localhost kernel: asterisk[823]: segfault at a4 ip 0072da00 sp b6ebe904 error 4 in libpthread-2.9.so[726000+16000]
Comments:By: Leif Madsen (lmadsen) 2011-07-11 14:46:06.993-0500

Thank you for your bug report. In order to move your issue forward, we require a backtrace[1] from the core file produced after the crash. Also, be sure you have DONT_OPTIMIZE enabled in menuselect within the Compiler Flags section, then:

make install

After enabling, reproduce the crash, and then execute the backtrace[1] instructions. When complete, attach that file to this issue report.

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

By: agustina (agustina) 2011-07-12 09:39:57.298-0500

Thanks a lot!
One question:
enabling DONT_OPTIMIZE in menuselect within the Compiler Flags section, and afterwards "make install" will cause problems in my asterisk?
Because I have it installed in a client.

Thanks a lot!

By: Leif Madsen (lmadsen) 2011-07-20 13:01:36.652-0500

That's a question I can't answer. It depends entirely on the system, the load, and many factors. You should reproduce on your development systems first.

By: Leif Madsen (lmadsen) 2011-08-10 16:17:20.273-0500

Assigned to reporter. Please provide feedback or we'll need to close this out.

By: Leif Madsen (lmadsen) 2011-09-14 08:52:09.884-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

By: agustina (agustina) 2011-09-14 14:51:11.539-0500

Can you reopen the issue, I have the backtraces.

By: agustina (agustina) 2011-09-14 14:53:40.418-0500

backtraces using the gdb

By: Gregory Hinton Nietsky (irroot) 2011-09-15 00:38:33.789-0500

From the docs.

   This function does _not_ return a reference to the bridged channel. The reason for this is mostly historical. It _should_ return a reference, but it will take a lot of work to make the code base account for that. So, for now, the old rules still apply for how to handle this function. If this function is being used from the channel thread that owns the channel, then a reference is already held, and channel locking is not required to guarantee that the channel will stay around. If this function is used outside of the associated channel thread, the channel parameter 'chan' MUST be locked before calling this function. Also, 'chan' must remain locked for the entire time that the result of this function is being used.

By: Stefan Schmidt (schmidts) 2011-09-15 02:31:27.300-0500

patch makes sense and should fix this problem.

ship it ;)

By: Leif Madsen (lmadsen) 2011-09-15 07:02:34.365-0500

Issue reopened!

By: Leif Madsen (lmadsen) 2011-09-15 07:53:26.524-0500

Committed and fixed by irroot, 1.8 branch at #335991

By: agustina (agustina) 2011-09-15 13:25:42.929-0500

Will this patch affect the operative of the call center in any way?
For example agents won´t be able to make transfers for a small period of time?

Can you please explain with more detail how to install this patch? For example do we need to restart asterisk service?


By: Gregory Hinton Nietsky (irroot) 2011-09-15 13:33:47.524-0500

You need to download the source code and patch it with the file attached.

all it does is prevent the error the lock it holds could slow things down negligibly.

it will be available in asterisk-1.8.8.

By: agustina (agustina) 2011-09-15 13:41:51.548-0500

I have asterisk, this patch works with it?
I have the asterisk already installed, the command to patch would be the following, confirm please:

patch asterisk- < chan_agent.patch


By: Gregory Hinton Nietsky (irroot) 2011-09-15 14:58:54.462-0500

the patch may work with it it does for 1.8 / 10 / trunk
cd into the source directory
patch -p0 < /path/to/patch/chan_agent.patch