[Home]

Summary:ASTERISK-16499: [patch] Asterisk crashes at startup on Solaris SPARC
Reporter:Ian Mason (ian mason)Labels:
Date Opened:2010-08-04 00:49:04Date Closed:2010-08-06 13:58:39
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100806__issue17789__2.diff.txt
Description:Asterisk crashes at startup, vis:

equinox:root# /export/Packages/asterisk-root-1.8.0-beta2/usr/sbin/asterisk -C /export/Packages/asterisk-root-1.8.0-beta2/etc/asterisk/asterisk.conf -dcvvvv
Asterisk 1.8.0-beta2, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
 == Parsing '/export/Packages/asterisk-root-1.8.0-beta2/etc/asterisk/asterisk.conf': Parsing /export/Packages/asterisk-root-1.8.0-beta2/etc/asterisk/asterisk.conf
 == Found
No ethernet interface found for seeding global EID. You will have to set it manually.
Parsing /export/Packages/asterisk-root-1.8.0-beta2/etc/asterisk/asterisk.conf
 == Parsing '/export/Packages/asterisk-root-1.8.0-beta2/etc/asterisk/asterisk.conf':   == Found
Bus Error (core dumped)

****** STEPS TO REPRODUCE ******

Run asterisk

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

Backtrace

equinox:root# gdb ./usr/sbin/asterisk core
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10"...
Reading symbols from
[... ETC ETC ...]
Loaded symbols for /lib/ld.so.1
Core was generated by `/export/Packages/asterisk-root-1.8.0-beta2/usr/sbin/asterisk -C /export/Package'.
Program terminated with signal 10, Bus error.
#0  __ast_string_field_alloc_space (mgr=0x20d24c, pool_head=0x20d234, needed=86) at utils.c:1638
1638            AST_STRING_FIELD_ALLOCATION(result) = needed;
(gdb) bt
#0  __ast_string_field_alloc_space (mgr=0x20d24c, pool_head=0x20d234, needed=86) at utils.c:1638
#1  0x000df1c4 in ast_manager_register2 (action=0x188cf0 "DataGet", auth=0, func=0x993d4 <manager_data_get>,
   synopsis=<value optimized out>, description=<value optimized out>) at manager.c:4956
#2  0x00094d14 in ast_data_init () at data.c:3290
#3  0x0004920c in main (argc=<value optimized out>, argv=0xffbffb4c) at asterisk.c:3670
(gdb) q
Comments:By: Paul Belanger (pabelanger) 2010-08-04 14:58:54

We need an unoptimized backtrace to help triage the issue.
---
Thank you for your bug report. In order to move your issue forward, we require a backtrace from the core file produced after the crash. Please see the doc/backtrace.txt file in your Asterisk source directory.

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 instructions in doc/backtrace.txt.

When complete, attach that file to this issue report. Thanks!

By: Ian Mason (ian mason) 2010-08-05 11:25:03

Tested patch. Patch as it stands fails to compile, vis:

       utils.c:1638: error: invalid operands to binary % (have ‘char *’ and ‘unsigned int’

Adding cast to line 1638 so that it reads:

       if ( ((unsigned int) result) % sizeof(ast_string_field_allocation)) {

compiles and will start.

It eventually crashes much, much, much later after running all the configuration and apparently even talking some SIP. This is after 1600+ lines of output at -dcvvvv level so I think we can assume that the immediate issue is solved.

By: Ian Mason (ian mason) 2010-08-05 11:37:30

New backtrace below just in case the latest crash is related to the original problem. Note this is a full working setup, not a minimised setup to trace the issue so there's 1000 variables that make it likely that this is totally unrelated to the original crash but I do see the tell-tale word "Allocating" so I've posted it as, at least, an FYI.

*CLI> Allocating new SIP dialog for 39469b5a-13c4-34-c8fa-593f - REGISTER (No RTP)
Store REGISTER's Contact header for call routing.
   -- Registered SIP '201' at 90.155.70.57:5060
Allocating new SIP dialog for 000015b50000164800000c040000229e@90.155.70.34:0 - OPTIONS (No RTP)
Bus Error (core dumped)
equinox:root#

Program terminated with signal 10, Bus error.
#0  0x001c4018 in __ast_string_field_ptr_build_va (mgr=0xfc6b28, pool_head=0xfc6a74, ptr=0xfc6b14, format=0xfdf65110 "<sip:%s%s%s>",
   ap1=0xfc1f9744, ap2=0xfc1f9744) at utils.c:1741
1741                    AST_STRING_FIELD_ALLOCATION(target) = needed;
(gdb)
(gdb) bt
#0  0x001c4018 in __ast_string_field_ptr_build_va (mgr=0xfc6b28, pool_head=0xfc6a74, ptr=0xfc6b14, format=0xfdf65110 "<sip:%s%s%s>",
   ap1=0xfc1f9744, ap2=0xfc1f9744) at utils.c:1741
#1  0x001c4160 in __ast_string_field_ptr_build (mgr=0xfc6b28, pool_head=0xfc6a74, ptr=0xfc6b14, format=0xfdf65110 "<sip:%s%s%s>") at utils.c:1763
#2  0xfdeceec8 in build_contact (p=0xfc6a68) at chan_sip.c:10939
#3  0xfded06c4 in initreqprep (req=0xfc1fa0ec, p=0xfc6a68, sipmethod=3, explicit_uri=0x0) at chan_sip.c:11107
#4  0xfded0d54 in transmit_invite (p=0xfc6a68, sipmethod=3, sdp=0, init=2, explicit_uri=0x0) at chan_sip.c:11212
ASTERISK-1  0xfdf2dbd0 in sip_poke_peer (peer=0xf0dde0, force=0) at chan_sip.c:24538
ASTERISK-2  0xfdedf6bc in parse_register_contact (pvt=0xfc5650, peer=0xf0dde0, req=0xfc1fb89c) at chan_sip.c:13001
ASTERISK-3  0xfdee2974 in register_verify (p=0xfc5650, addr=0xfc1fb790, req=0xfc1fb89c, uri=0xfc455d "sip:equinox.ian.co.uk:5060;transport=UDP")
   at chan_sip.c:13624
ASTERISK-4  0xfdf250f8 in handle_request_register (p=0xfc5650, req=0xfc1fb89c, addr=0xfc1fb790, e=0xfc455d "sip:equinox.ian.co.uk:5060;transport=UDP")
   at chan_sip.c:23138
ASTERISK-5  0xfdf268fc in handle_incoming (p=0xfc5650, req=0xfc1fb89c, addr=0xfc1fb790, recount=0xfc1fb700, nounlock=0xfc1fb6fc) at chan_sip.c:23383
ASTERISK-6 0xfdf282b4 in handle_request_do (req=0xfc1fb89c, addr=0xfc1fb790) at chan_sip.c:23669
ASTERISK-7 0xfdf276ec in sipsock_read (id=0xf330d0, fd=11, events=1, ignore=0x0) at chan_sip.c:23567
ASTERISK-8 0x0011b5f4 in ast_io_wait (ioc=0x58caa8, howlong=1000) at io.c:288
ASTERISK-9 0xfdf2a3c0 in do_monitor (data=0x0) at chan_sip.c:24084
ASTERISK-10 0x001c1a14 in dummy_start (data=0xef9f70) at utils.c:971
ASTERISK-11 0xfecc6d54 in _lwp_start () from /usr/lib/libc.so.1
ASTERISK-12 0xfecc6d54 in _lwp_start () from /usr/lib/libc.so.1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

By: Tilghman Lesher (tilghman) 2010-08-06 10:47:02

Okay, patch uploaded that should fix this latest issue.

By: Tilghman Lesher (tilghman) 2010-08-06 11:18:06

Just in case you were faster than me, I've uploaded another patch.

By: Ian Mason (ian mason) 2010-08-06 11:24:59

"Just in case you were faster than me"... nearly, I got distracted by an email JUST long enough to not have yet downloaded the patch. I'll download it now, build and report back in an hour or so.

By: Ian Mason (ian mason) 2010-08-06 12:01:37

Tested. Success. Asterisk comes up and can route calls.

By: Digium Subversion (svnbot) 2010-08-06 13:57:09

Repository: asterisk
Revision: 281085

U   branches/1.8/main/utils.c

------------------------------------------------------------------------
r281085 | tilghman | 2010-08-06 13:57:08 -0500 (Fri, 06 Aug 2010) | 8 lines

Fix alignment of stringfields on the SPARC platform

(closes issue ASTERISK-16499)
Reported by: Ian Mason
Patches:
      20100806__issue17789__2.diff.txt uploaded by tilghman (license 14)
Tested by: Ian_Mason

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

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

By: Digium Subversion (svnbot) 2010-08-06 13:57:37

Repository: asterisk
Revision: 281085

U   branches/1.8/main/utils.c

------------------------------------------------------------------------
r281085 | tilghman | 2010-08-06 13:57:10 -0500 (Fri, 06 Aug 2010) | 8 lines

Fix alignment of stringfields on the SPARC architecture

(closes issue ASTERISK-16499)
Reported by: Ian Mason
Patches:
      20100806__issue17789__2.diff.txt uploaded by tilghman (license 14)
Tested by: Ian_Mason

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

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

By: Digium Subversion (svnbot) 2010-08-06 13:58:38

Repository: asterisk
Revision: 281086

_U  trunk/
U   trunk/main/utils.c

------------------------------------------------------------------------
r281086 | tilghman | 2010-08-06 13:58:38 -0500 (Fri, 06 Aug 2010) | 15 lines

Merged revisions 281085 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r281085 | tilghman | 2010-08-06 13:57:10 -0500 (Fri, 06 Aug 2010) | 8 lines
 
 Fix alignment of stringfields on the SPARC architecture
 
 (closes issue ASTERISK-16499)
  Reported by: Ian Mason
  Patches:
        20100806__issue17789__2.diff.txt uploaded by tilghman (license 14)
  Tested by: Ian_Mason
........

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

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