Summary:ASTERISK-13337: [patch] Asterisk crashes sometimes
Reporter:chitman (chitman)Labels:
Date Opened:2009-01-11 02:28:15.000-0600Date Closed:2009-01-30 10:20:51.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 14209.patch
( 1) 20090112__bug14209.diff.txt
( 2) bt1.txt
( 3) btfull.txt
( 4) details.txt
( 5) log.txt
Description:The Asterisk crashes randomly at least one time every day.

bt looks like it:
#0  0xb7c8617b in strlen () from /lib/libc.so.6
#1  0xb7c5538a in vfprintf () from /lib/libc.so.6
#2  0xb7c769f4 in vsnprintf () from /lib/libc.so.6
#3  0xb7c5b065 in snprintf () from /lib/libc.so.6
#4  0xb72b146d in set_queue_variables (qe=0xb633db20) at app_queue.c:606
ASTERISK-1  0xb72bd353 in end_bridge_callback (data=0xb633db20) at app_queue.c:3166
ASTERISK-2  0x080c395f in ast_bridge_call (chan=0x84d6858, peer=0x8249868, config=0x8521e20) at features.c:2183
ASTERISK-3  0x080bbddd in ast_bridge_call_thread (data=0x8521e20) at features.c:278
ASTERISK-4  0x0814aca4 in dummy_start (data=0x81f7c20) at utils.c:917
ASTERISK-5  0xb7bfe383 in start_thread () from /lib/libpthread.so.0
ASTERISK-6 0xb7cea05e in clone () from /lib/libc.so.6

or it:

#0  0x0807b1bc in INTERNAL_OBJ (user_data=0x4) at astobj2.c:114
#1  0x0807b12c in ?? ()
#2  0xb738e348 in end_bridge_callback (data=0xb6338b20) at app_queue.c:3165
#3  0x080c395f in ast_bridge_call (chan=0x85840f8, peer=0x8410958, config=0x8539a68) at features.c:2183
#4  0x080bbddd in ast_bridge_call_thread (data=0x8539a68) at features.c:278
ASTERISK-1  0x0814aca4 in dummy_start (data=0x82fd600) at utils.c:917
ASTERISK-2  0xb7d1c383 in start_thread () from /lib/libpthread.so.0
ASTERISK-3  0xb7e0805e in clone () from /lib/libc.so.6

Comments:By: Leif Madsen (lmadsen) 2009-01-11 10:38:10.000-0600

Do you have any additional information in regards to how to reproduce this issue?

By: chitman (chitman) 2009-01-12 02:19:22.000-0600

I have added full backtrace in btfull.txt and info from a logfile in log.txt.
I'm waiting for crash now with debug=4 and verbose=4 for granting more informative output for you.

By: Tilghman Lesher (tilghman) 2009-01-12 12:49:04.000-0600

If you can create a repeatable case, please try this patch.

By: chitman (chitman) 2009-01-13 04:47:23.000-0600

I don't know in which case it crashes. I'm testing this patched version now and I'll tell you about results later.

By: Carlos Cesario (ccesario) 2009-01-13 07:26:55.000-0600

I think that I too have this problem, I get this in CLI console

[Jan 13 11:18:09] ERROR[18472]: astobj2.c:116 INTERNAL_OBJ: bad magic number 0x81aea1c for 0x83af984

and asterisk restarts ...the bt results is attached.

By: Leif Madsen (lmadsen) 2009-01-13 11:55:20.000-0600

Issue has a patch attached for testing.

By: chitman (chitman) 2009-01-14 05:19:33.000-0600

I have got the same error now. I have uploaded details about this crash in the details.txt.

By: Tilghman Lesher (tilghman) 2009-01-14 14:00:23.000-0600

Okay, it looks like memory corruption.  Let's try following the instructions in doc/valgrind.txt.

By: Carlos Cesario (ccesario) 2009-01-19 15:56:09.000-0600


  Maybe results of bug 14260 can help...

By: Leif Madsen (lmadsen) 2009-01-20 14:22:29.000-0600

I have marked the issues as duplicate between here and 14260, but I'd like Corydon76 to verify if that is the case before I close one of the issues down.


By: Mark Michelson (mmichelson) 2009-01-22 18:41:27.000-0600

I can verify that this is a duplicate of 14260.

The problem is that when an attended transfer occurs, the end_bridge_callback is called for app_queue and is passed data which was previously on the stack but which since has gone out of scope. I have been working on issue 14260 and have worked out the circumstances for this bug but have not yet formulated a patch to fix the issue. I expect that I will have something ready tomorrow, though.

By: Mark Michelson (mmichelson) 2009-01-23 14:14:39.000-0600

I have uploaded a patch which fixed the issue for me. The patch I have uploaded here is functionally equivalent to the patch uploaded for issue ASTERISK-13384. The difference is that the patch posted here is for the 1.6.0 branch of Asterisk and the patch on issue ASTERISK-13384 is for Asterisk trunk.

Please test and let me know if there are any issues with this patch.

By: Leif Madsen (lmadsen) 2009-01-28 15:29:03.000-0600

Ping! Have an ETA on testing? Thanks!

By: chitman (chitman) 2009-01-28 23:24:08.000-0600

I applied patch today and testing it now. I'll report about results later.

By: Mark Michelson (mmichelson) 2009-01-30 10:20:50.000-0600

Since the reporter of issue ASTERISK-13384 reported that this patch fixed the problem for him, I went ahead and merged the patch into Asterisk trunk, 1.6.0, and 1.6.1.

Since the code has already been merged into Asterisk, I am going to close this issue, too. If you find that this does not work, please feel free to re-open this issue and I will examine this more closely.