[Home]

Summary:ASTERISK-07211: [patch] asterisk segfault after a signout/signin back
Reporter:Clod Patry (junky)Labels:
Date Opened:2006-06-21 01:21:09Date Closed:2006-06-30 11:04:52
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_jingle
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) fix.diff
( 1) invalid_email.txt
( 2) jingle_1.txt
( 3) jingle_2.txt
( 4) offline.txt
Description:When using res_jabber.c/chan_jingle.c tonight, i got some segfault.
This is what happened exactly:
i told to paulc to signout then to signin back.
i received the unavailable message then it segfault, im attaching the backtrace infos for now, will try to reproduce to get ya the jabber debug.
Comments:By: Clod Patry (junky) 2006-06-21 01:34:21

when * was idle, i got that segfault (jingle_2.txt)

By: Andrey S Pankov (casper) 2006-06-21 09:28:45

In the 1st case it fails in ast_copy_string. Is it reproducible if built dont-optimize?

In the 2nd case it fails in libiksemel. What library version are you using?

By: Clod Patry (junky) 2006-06-21 19:11:40

Before i forget:
   -- Executing [52@polycom:1] JABBERSend("SIP/10-db3f", "asterisk|juliedube01@gmail.com|hi baby, from Asterisk :)") in new stack
polux*CLI>
JABBER: asterisk OUTGOING: <message type='chat' to='juliedube01@gmail.com' from='cpatry@gmail.com/asteriskFD1993C1'><body>hi baby, from Asterisk :)</body></message>
 == Auto fallthrough, channel 'SIP/10-db3f' status is 'UNKNOWN'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '"JunK-Y" <10>'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '10'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '52'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'polycom'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'SIP/10-db3f'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'JABBERSend'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'asterisk|juliedube01@gmail.com|hi baby, from Asterisk :)'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '2006-06-21 20:16:27'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '2006-06-21 20:16:27'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '0'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '0'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'NO ANSWER'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'DOCUMENTATION'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '1150931787.0'
Jun 21 20:16:27 DEBUG[30736]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
polux*CLI>
Disconnected from Asterisk server
Attempting to reconnect for 30 seconds


this is when juliedube01@gmail.com is offline, it crashes each time.

debug info is in offline.txt

By: Clod Patry (junky) 2006-06-21 19:13:52

casper: for your questions:
1st crash is really hard to reproduce.

im using the debian package (sarge, stable).

polux:/tmp# dpkg --list|grep libik
ii  libiksemel1    1.2-1          iksemel is a C library for the Jabber IM pla
ii  libiksemel1-de 1.2-1          iksemel is a C library for the Jabber IM pla
polux:/tmp# uname -a
Linux polux 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux
polux:/tmp#

By: Clod Patry (junky) 2006-06-21 21:16:28

Another crash with this exact scenario: just place an invalid recipient when sending a message.
Example:
   -- Executing [52@polycom:1] JABBERSend("SIP/10-97fe", "asterisk|something@invalid_here|hi baby, from Asterisk :)") in new stack
polux*CLI>
JABBER: asterisk OUTGOING: <message type='chat' to='something@invalid_here' from='cpatry@gmail.com/asterisk810B5054'><body>hi baby, from Asterisk :)</body></message>
 == Auto fallthrough, channel 'SIP/10-97fe' status is 'UNKNOWN'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '"JunK-Y" <10>'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '10'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '52'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'polycom'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'SIP/10-97fe'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'JABBERSend'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'asterisk|something@invalid_here|hi baby, from Asterisk :)'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '2006-06-21 22:21:26'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '2006-06-21 22:21:26'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '0'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '0'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'NO ANSWER'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is 'DOCUMENTATION'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is '1150939286.0'
Jun 21 22:21:26 DEBUG[4879]: pbx.c:1529 pbx_substitute_variables_helper_full: Function result is ''
polux*CLI>
JABBER: asterisk INCOMING: <message type="error" to="cpatry@gmail.com/asterisk810B5054" from="something@invalid_here"><body>hi baby, from Asterisk :)</body><error code="400" type="modify"><jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Malformed JID 'something@invalid_here': domain label contains illegal character '_'</text></error></message>
Jun 21 22:21:26 NOTICE[4848]: res_jabber.c:1093 aji_handle_message: therse a message insert
polux*CLI>
Disconnected from Asterisk server
Attempting to reconnect for 30 seconds

polux:/etc/asterisk#

By: Andrey S Pankov (casper) 2006-06-22 10:49:28

junky: are your backtraces from dont-optimize'd build?

By: Andrey S Pankov (casper) 2006-06-22 10:58:48

Could you please print insert->id, pak->id, sizeof(insert->message) in GDB?

By: Clod Patry (junky) 2006-06-27 22:32:59

So far, that patch fixed all my 2 issues:
- dest user is offline
- dest user email is invalid.

It was just a bad 3rd argument passed to ast_copy_string and pak->id is NULL sometime.

Let me know whatcha think.



By: Andrey S Pankov (casper) 2006-06-29 18:26:25

It seems like that bug was already fixed in another way in the trunk r36175...

By: Clod Patry (junky) 2006-06-30 11:04:37

i can confirm Revision: 36176 fixed these problems.