[Home]

Summary:ASTERISK-18883: Asterisk TestSuite - test SIP/realtime_sipregs seg faults on exit
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2011-11-17 17:09:21.000-0600Date Closed:2012-01-09 13:44:01.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Tests/testsuite
Versions:10.0.0-rc2 Frequency of
Occurrence
Related
Issues:
Environment:Ubuntu Lucid VMAttachments:
Description:After mnicholson placed his patch in to auto-fail a test when an instance of Asterisk exits non-cleanly, the tests/channels/SIP/realtime_sipregs test consistently seg faults.  Looking at the attached backtrace, this happens in asterisk.c quit_handler on the call to exit(0).

Example logs below:

http://bamboo.asterisk.org/browse/AST10-LUCID-357/
http://bamboo.asterisk.org/browse/ASTTRUNK-LUCID-AMD64-1228/

Note that this test does not fail in the 1.8 branch tests.  As such, I've marked the issue as a regression.

This test will be set to skip and linked to this issue until it can be resolved.
Comments:By: Walter Doekes (wdoekes) 2011-11-21 03:53:36.324-0600

Backtrace:

http://bamboo.asterisk.org/artifact/AST10-LUCID/AMD64/build-358/testsuite/channels/SIP/realtime_sipregs/backtrace.txt

{noformat}
Thread 16 (Thread 10768):
#7  0x0000000000452dc8 in quit_handler (num=0, niceness=1, safeshutdown=1,
   restart=0) at asterisk.c:1727
...
#10 0x00000000004de8bb in ast_cli_command_multiple_full (uid=0, gid=0, fd=48,
   size=21, s=0x7f2a55ee6b4f "core stop gracefully") at cli.c:2525
#11 0x000000000045004d in netconsole (vconsole=0x9aefc0) at asterisk.c:1275
{noformat}

{noformat}
Thread 1 (Thread 10801):
#0  0x00007f2a83fd01b5 in exit () from /lib/libc.so.6
#1  0x0000000000452dc8 in quit_handler (num=0, niceness=0, safeshutdown=1,
   restart=0) at asterisk.c:1727
#2  0x0000000000453909 in handle_stop_now (e=0x912aa8, cmd=-4,
   a=0x7f2a574157c0) at asterisk.c:1888
...
#4  0x00000000004de8bb in ast_cli_command_multiple_full (uid=0, gid=0, fd=0,
   size=14, s=0x7f2a57415b4f "core stop now") at cli.c:2525
#5  0x000000000045004d in netconsole (vconsole=0x9af000) at asterisk.c:1275
{noformat}

In the logs, we find this about half-way:

http://bamboo.asterisk.org/artifact/AST10-LUCID/AMD64/build-358/testsuite/channels/SIP/realtime_sipregs/ast1/var/log/asterisk/full.txt

{noformat}
[Nov 17 13:38:33] VERBOSE[10710] asterisk.c:     -- Remote UNIX connection
{noformat}

after which lots of unloading/unregistering begins.

Then, a minute later, we get a second one:

{noformat}
[Nov 17 13:39:38] VERBOSE[10710] asterisk.c:     -- Remote UNIX connection
{noformat}

Looks like a safeguard kill and the problem is really in Thread 16 which refuses to die because it is doing a blocking read.

{noformat}
Thread 16 (Thread 10768):
#0  0x00007f2a8406f4bd in read () from /lib/libc.so.6
#1  0x00007f2a84009c3f in ?? () from /lib/libc.so.6
#2  0x00007f2a83fffa62 in fread () from /lib/libc.so.6
#3  0x00007f2a6b8c1a23 in gcov_read_words ()
  from /tmp/asterisk-testsuite/channels/SIP/realtime_sipregs/ast1/usr/lib/asterisk/modules/res_calendar_caldav.so
#4  0x00007f2a6b8c1ace in __gcov_read_unsigned ()
  from /tmp/asterisk-testsuite/channels/SIP/realtime_sipregs/ast1/usr/lib/asterisk/modules/res_calendar_caldav.so
#5  0x00007f2a6b8c1e98 in gcov_exit ()
  from /tmp/asterisk-testsuite/channels/SIP/realtime_sipregs/ast1/usr/lib/asterisk/modules/res_calendar_caldav.so
#6  0x00007f2a83fd0262 in exit () from /lib/libc.so.6
#7  0x0000000000452dc8 in quit_handler (num=0, niceness=1, safeshutdown=1,
   restart=0) at asterisk.c:1727
#8  0x00000000004539e9 in handle_stop_gracefully (e=0x912b70, cmd=-4,
   a=0x7f2a55ee67c0) at asterisk.c:1908
#9  0x00000000004de5e7 in ast_cli_command_full (uid=0, gid=0, fd=48,
   s=0x7f2a55ee68d0 "core stop gracefully") at cli.c:2502
#10 0x00000000004de8bb in ast_cli_command_multiple_full (uid=0, gid=0, fd=48,
   size=21, s=0x7f2a55ee6b4f "core stop gracefully") at cli.c:2525
#11 0x000000000045004d in netconsole (vconsole=0x9aefc0) at asterisk.c:1275
#12 0x0000000000661db6 in dummy_start (data=0x2c731a0) at utils.c:1010
#13 0x00007f2a868899ca in start_thread () from /lib/libpthread.so.0
#14 0x00007f2a8407d70d in clone () from /lib/libc.so.6
#15 0x0000000000000000 in ?? ()
{noformat}


By: Terry Wilson (twilson) 2012-01-07 22:27:03.304-0600

Walter, can you verify that the patch at https://reviewboard.asterisk.org/r/1658/ fixes the issue for you?

By: Walter Doekes (wdoekes) 2012-01-08 06:53:21.706-0600

Doesn't, but r1659 does ;)