[Home]

Summary:ASTERISK-19532: Asterisk crashed after connecting with jabber server in component mode
Reporter:Karsten Wemheuer (kwemheuer)Labels:
Date Opened:2012-03-13 12:42:58Date Closed:2012-10-03 21:13:27
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_jabber
Versions:1.8.10.0 1.8.11.0 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-19557 [Regression] Segfault in res_jabber.c
Environment:Debian squeeze, asterisk 1.8.10.0Attachments:( 0) fix-jabber
( 1) xmpp_no_crash_with_ejabberd.patch
Description:I connect asterisk with a xmpp server in component mode (jabberd2). Up to asterisk 1.8.8.2 all was working fine. In version 1.8.10.0 asterisk crashes on startup after handshaking with jabber server.

I do a backtrace and some debugging, and I found out, that the crash happens in function aji_dinfo_handler() at the end. In line 2203:
{code}
ASTOBJ_UNREF(buddy, ast_aji_buddy_destroy);
{code}
the macro is called with buddy=NULL. In 1.8.8.2 there was no call to this macro.

The attached simple patch solves the issue, but I am not sure, that this is the right way. The statement mentioned above was added in many places in res_jabber.c between version 1.8.8.2 and 1.8.10.0. Should all get fixed this way?
Comments:By: Karsten Wemheuer (kwemheuer) 2012-03-14 02:53:37.755-0500

I found a link to review board https://reviewboard.asterisk.org/r/1553/. There are fixes for some leaks discussed for chan_gtalk, chan_jingle and res_jabber. In chan_gtalk there is a if statement around the UNREF, so that a NULL-Pointer would not cause a crash. This if statement is missing in res_jabber (See my patch). But I am not familiar with the code, so that I am not sure, if every UNREF needs an if wrapper around.

By: Byron Clark (byronclark) 2012-04-25 11:43:35.098-0500

We're seeing the same issue. I've attached the patch we're using: [^xmpp_no_crash_with_ejabberd.patch]

By: Matt Jordan (mjordan) 2012-10-04 08:36:20.904-0500

I went ahead and committed Byron's patch, with some small modifications to resolve ASTERISK-19557 as well.  If this doesn't resolve this issue, please let me know and I'll reopen it.  Thanks!