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
Versions: Frequency of
is related toASTERISK-19557 [Regression] Segfault in res_jabber.c
Environment:Debian squeeze, asterisk 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 all was working fine. In version 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:
ASTOBJ_UNREF(buddy, ast_aji_buddy_destroy);
the macro is called with buddy=NULL. In 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 and 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!