jabber segfaults on client disconnect

Bug #35953 reported by kitchen
34
Affects Status Importance Assigned to Milestone
jabber (Debian)
Fix Released
Unknown
jabber (Ubuntu)
Fix Released
High
Unassigned

Bug Description

jabberd segfaults on client exit in my configuration, updated to everything dapper-current as of 2200 MST 21 Mar 2006

package 1.4.3.-3ubuntu1 / dapper

sources.list presently
----
deb http://us.archive.ubuntu.com/ubuntu dapper multiverse universe main restricted
----
configuration previously working in breezy, so I'm fairly confident that's not the cause.

also installed and possibly relevant

jabber-common 0.4
jabber-jit 1.1.6-9build2
jabber-jud 0.5-3
jabber-muc 0.6.0-2
jabber-yahoo 2.3.2-1

Revision history for this message
kitchen (kitchen-506) wrote :

jabberd segfaults on client exit in my configuration, updated to everything dapper-current as of 2200 MST 21 Mar 2006

package 1.4.3.-3ubuntu1 / dapper

sources.list presently
----
deb http://us.archive.ubuntu.com/ubuntu dapper multiverse universe main restricted
----
configuration previously working in breezy, so I'm fairly confident that's not the cause.

also installed and possibly relevant

jabber-common 0.4
jabber-jit 1.1.6-9build2
jabber-jud 0.5-3
jabber-muc 0.6.0-2
jabber-yahoo 2.3.2-1

Revision history for this message
drewp (drewp) wrote :

I see the same thing with my dapper, jabber 1.4.3-3ubuntu1. Here is the output when I run jabberd with -D and close a client:

Sat Apr 1 11:13:21 2006 mio.c:829 mio while loop, working
Sat Apr 1 11:13:21 2006 mio.c:977 MIO read from socket 13: <presence type='unavailable'></presence></stream:stream>
Sat Apr 1 11:13:21 2006 c2s [client.c:282] pthsock_client_read called with: m:80B2980 flag:3 arg:80B2A78
Sat Apr 1 11:13:21 2006 deliver.c:474 DELIVER 4:jabber.bigasterisk.com <route <email address hidden>/81C15C8' from='13@c2s/80B2980'><presence type='unavailable'/></route>
Sat Apr 1 11:13:21 2006 deliver.c:678 delivering to instance 'sessions'
Sat Apr 1 11:13:21 2006 deliver.c:95 (80B2C50)incoming packet <route <email address hidden>/81C15C8' from='13@c2s/80B2980'><presence type='unavailable'/></route>
Sat Apr 1 11:13:21 2006 users.c:143 js_user(<email address hidden>,810C1B8)
Sat Apr 1 11:13:21 2006 c2s [client.c:282] pthsock_client_read called with: m:80B2980 flag:4 arg:80B2A78
Sat Apr 1 11:13:21 2006 c2s [client.c:287] io_select Socket 13 close notification
Sat Apr 1 11:13:21 2006 deliver.c:474 DELIVER 4:jabber.bigasterisk.com <route type='error' <email address hidden>/81C15C8' from='13@c2s/80B2980'/>
Sat Apr 1 11:13:21 2006 deliver.c:678 delivering to instance 'sessions'
Sat Apr 1 11:13:21 2006 deliver.c:95 (80B2C50)incoming packet <route type='error' <email address hidden>/81C15C8' from='13@c2s/80B2980'/>
Sat Apr 1 11:13:21 2006 users.c:143 js_user(<email address hidden>,810C1B8)
Sat Apr 1 11:13:21 2006 sessions.c:159 end 136058312 'Disconnected'
Sat Apr 1 11:13:21 2006 mio_ssl.c:133 SSL Cleanup for 0
Sat Apr 1 11:13:21 2006 mio.c:505 freed MIO socket
Sat Apr 1 11:13:21 2006 mtq 810BCE0 entering from pth
Sat Apr 1 11:13:21 2006 mtq 810BCE0 queue call 821CC20
Sat Apr 1 11:13:21 2006 mtq 810BCE0 queue call 81C15C8
Sat Apr 1 11:13:21 2006 sessions.c:331 THREAD:SESSION exiting
Sat Apr 1 11:13:21 2006 modules.c:135 mapi_call 2
Sat Apr 1 11:13:21 2006 modules.c:158 MAPI 81C1880
Sat Apr 1 11:13:21 2006 mod_last storing last for user <email address hidden>
Sat Apr 1 11:13:21 2006 dnsrv.c:155 dnsrv: Read error on coprocess(1): 0 Successzsh: segmentation fault sudo jabberd -D -c /etc/jabber/jabber.xml

Sat Apr 1 11:13:21 2006 dnsrv.c:169 DNSRV CHILD: out of loop.. exiting normal

Revision history for this message
drewp (drewp) wrote :

downgrading from 1.4.3-3ubuntu1 to 1.4.3-3 is a successful workaround

Revision history for this message
Michael Heča (orgoj) wrote :

confirm

Revision history for this message
Ronny Bangsund (ronnyb) wrote :

jabber_1.4.3-3ubuntu1_i386 also exits when the last user
leaves the server here. "Will the last user please turn off
the lights?" :)

Revision history for this message
Paul Goscicki (paulgoscicki) wrote :

Confirming, after upgrading from Breezy to Dapper jabber_1.4.3-3ubuntu1_i386 segfaults both on last client disconnect and while trying to register a new user.

Manually downloading jabber_1.4.3-3_i386.deb and installing it via 'dpkg -i jabber_1.4.3-3_i386.deb' solves those problems.

Changed in jabber:
importance: Medium → High
status: Unconfirmed → Confirmed
Revision history for this message
Jan (debian-gepro) wrote : Quo vadis Ubuntu ?

I was caught by this error on 2006-06-25 after upgrading my server to dapper. Is there any particular reason to keep a totaly broken jabber package in the archive and install it by default ?

Revision history for this message
Ronny Bangsund (ronnyb) wrote :

I suggest a simple rebuild to fix this. I downloaded the source and
build-deps and rebuilt it, so now everything is stable again.

Revision history for this message
Ronny Bangsund (ronnyb) wrote :

OK, I spoke to soon. I recompiled it on the real
server machine and it quit on registration/users
leaving again.

Revision history for this message
Ronny Bangsund (ronnyb) wrote :

I have found the cause of the unstable Jabber server.

It works on this box, compiled with gcc version 3.4.6 (Ubuntu 3.4.6-1ubuntu2).

It crashes for various reasons/after max 30 minutes on
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

So the older version of GCC is required to compile a stable server.

Revision history for this message
Vassilis Pandis (pandisv) wrote :

A backtrace would be ideal to confirm this, but apparently this is a known issue in the Debian BTS, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=337526 .

Revision history for this message
Ivo Mans (ivomans) wrote :

Actually this Debian bug 337526 describes a crash when registering a new user, the issue described here is a crash when the last user logs out. Although both issues seem related to the compiler used, they are not exactly same.

Also I experienced these crashes after last user logs out since I upgraded to dapper. Downgrade to 1.4.3-3 solved the issue.

Changed in jabber:
status: Unknown → Unconfirmed
Revision history for this message
Vassilis Pandis (pandisv) wrote :

IMHO they still could be releated (of course I'm very likely to be wrong :-). I only say this by comparing the backtrace with the log posted here. If someone could provide a debug backtace it would really help in figuring out if this is indeed the situation or if they are seperate bug reports. In any case, a debug backtrace is neccessary to fix this.

Revision history for this message
Ivo Mans (ivomans) wrote :

Attached my backtrace result when the last user logs out.
It's my first backtrace experience, let me know if you need anything else.

Revision history for this message
Ivo Mans (ivomans) wrote :

Attached my backtrace result when the last user logs out.
It's my first backtrace experience, let me know if you need anything else.

Revision history for this message
Robin Sheat (eythian) wrote :

I'd like to add a 'me too' to this. Here's a bit of an strace, not too helpful, I was just using it to make sure it was the same problem:

[pid 9661] rt_sigaction(SIGUSR2, {SIG_DFL}, NULL, 8) = 0
[pid 9661] gettimeofday({1162948399, 548162}, NULL) = 0
[pid 9661] sigprocmask(SIG_SETMASK, [], ~[KILL STOP RTMIN]) = 0
[pid 9661] time(NULL) = 1162948399
[pid 9661] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 9661 detached
<... read resumed> "", 1024) = 0
exit_group(0) = ?
Process 9664 detached

Revision history for this message
Robin Sheat (eythian) wrote :

Also confirm that the downgrade fixes the problem. According to this: http://dococonutsmigrate.blogspot.com/2006/09/jabber-on-dapper-not-that-easy.html
different compiler versions are the problem.

Revision history for this message
In , Andreas Barth (andreas-barth) wrote : severity adjustments

severity 404378 serious
severity 337526 serious
severity 334414 important

Revision history for this message
In , Sergei Golovan (sgolovan) wrote : Re: jabber: Segmentation fault if compiled with gcc-4.0

tags 337526 + patch
thanks

Hi!

I seem to find out the cause of the segfault. Sometimes jabberd uses string
representation of time(NULL). And it allocates only 10 chars for it, which
is too few (currently decimal result of time(NULL) is a 10-digit number, but
there should be a trailing '\0' also).

Attached patch fixes this issue and increases buffers in a few other
suspicious places.

--
Sergei Golovan

Revision history for this message
In , Andreas Barth (aba) wrote : NMU uploaded
Download full text (7.7 KiB)

Hi,

I uploaded an NMU of your package.

Please see this as help to get the package into a releaseable condition for
etch.

Please find the used diff below.

Cheers,
Andi

diff -Nur ../jabber-1.4.3~/debian/changelog ../jabber-1.4.3/debian/changelog
--- ../jabber-1.4.3~/debian/changelog 2006-12-30 10:08:46.000000000 +0000
+++ ../jabber-1.4.3/debian/changelog 2006-12-31 09:47:17.000000000 +0000
@@ -1,3 +1,19 @@
+jabber (1.4.3-3.1) unstable; urgency=medium
+
+ [ Sergei Golovan ]
+ * added patch, which increases buffers for storing string representation
+ of time (Closes: #337526)
+ * bumped standards version to 3.7.2
+
+ [ Andreas Barth ]
+ * non-maintainer upload
+ * rebuild should change dependency from libpth2 to libpth20. Closes: #404378
+ * add IPv6-support. Closes: #334414
+ * fix typos in description and jabberd.8. Closes: #300020, #337538
+ * Update description, partly fixes #404816.
+
+ -- Andreas Barth <email address hidden> Sat, 30 Dec 2006 10:10:28 +0000
+
 jabber (1.4.3-3) unstable; urgency=low

   * added patch to correct libexpat vulnerability (Closes: #272408)
diff -Nur ../jabber-1.4.3~/debian/control ../jabber-1.4.3/debian/control
--- ../jabber-1.4.3~/debian/control 2006-12-30 10:08:46.000000000 +0000
+++ ../jabber-1.4.3/debian/control 2006-12-31 09:46:29.000000000 +0000
@@ -2,7 +2,7 @@
 Section: net
 Priority: optional
 Maintainer: Jamin W. Collins <email address hidden>
-Standards-Version: 3.6.1.0
+Standards-Version: 3.7.2
 Build-Depends: dpatch, libpth-dev (>=2.0.0), libssl-dev (>=0.9.5), debhelper (>=4), libexpat1-dev (>= 1.95.6)

 Package: jabber
@@ -11,20 +11,20 @@
 Conflicts: jabber-aim (<= 20030314-6), jabber-jit (<= 1.1.6-6), jabber-jud (<= 0.4-7), jabber-muc (<= 0.5.2-6), jabber-msn (<= 1.2.1-1.2.8rc1-1), jabber-yahoo (<= 2.2.0-1), jabber-dev (<< ${Source-Version})
 Replaces: jabber-transport
 Provides: jabber-transport, ${jabber:Provides}
-Description: Daemon for the jabber.org Open Source Instant Messenger
+Description: An instant messaging server using the Jabber/XMPP protocol
  Jabber is a Free Instant Messaging System
  .
  In this Package you will find jabberd, a message transport server
- based on a XML Message Routing Infrastructure.
+ based on an XML Message Routing Infrastructure.
  .
  All this high-tech is simply used to provide you with your own IM Server.
- See http://www.jabber.org/ for more details.
+ See http://www.jabberd.org/ for more details.
  .
  Jabber supports connecting to AIM, ICQ, IRC, MSN and a lot of others, so
  you can use all available IM systems from one client.
  .
  This package does not provide a jabber client. Some jabber clients are
- compared at http://www.jabber.org/user/clientlist.php?Platform=Linux
+ compared at http://en.wikipedia.org/wiki/List_of_Jabber_client_software

 Package: jabber-dev
 Section: devel
@@ -38,7 +38,7 @@
  jabber plugins e.g. transports.
  .
  All this high-tech is simply used to provide you with your own IM Server.
- See http://www.jabber.org/ for more details.
+ See http://www.jabberd.org/ for more details.
  .
  Jabber supports connecting to AIM, ICQ, IRC, MSN and a lot of others, so
  you can use all available IM systems from one...

Read more...

Revision history for this message
In , Andreas Barth (aba) wrote : Bug#337526: fixed in jabber 1.4.3-3.1

Source: jabber
Source-Version: 1.4.3-3.1

We believe that the bug you reported is fixed in the latest version of
jabber, which is due to be installed in the Debian FTP archive:

jabber-dev_1.4.3-3.1_amd64.deb
  to pool/main/j/jabber/jabber-dev_1.4.3-3.1_amd64.deb
jabber_1.4.3-3.1.diff.gz
  to pool/main/j/jabber/jabber_1.4.3-3.1.diff.gz
jabber_1.4.3-3.1.dsc
  to pool/main/j/jabber/jabber_1.4.3-3.1.dsc
jabber_1.4.3-3.1_amd64.deb
  to pool/main/j/jabber/jabber_1.4.3-3.1_amd64.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Barth <email address hidden> (supplier of updated jabber package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 30 Dec 2006 10:10:28 +0000
Source: jabber
Binary: jabber-dev jabber
Architecture: source amd64
Version: 1.4.3-3.1
Distribution: unstable
Urgency: medium
Maintainer: Jamin W. Collins <email address hidden>
Changed-By: Andreas Barth <email address hidden>
Description:
 jabber - An instant messaging server using the Jabber/XMPP protocol
 jabber-dev - Daemon for the jabber.org Open Source Instant Messenger
Closes: 300020 334414 337526 337538 404378
Changes:
 jabber (1.4.3-3.1) unstable; urgency=medium
 .
   [ Sergei Golovan ]
   * added patch, which increases buffers for storing string representation
     of time (Closes: #337526)
   * bumped standards version to 3.7.2
 .
   [ Andreas Barth ]
   * non-maintainer upload
   * rebuild should change dependency from libpth2 to libpth20. Closes: #404378
   * add IPv6-support. Closes: #334414
   * fix typos in description and jabberd.8. Closes: #300020, #337538
   * Update description, partly fixes #404816.
Files:
 c8da130d9f108df039083e7824352278 662 net optional jabber_1.4.3-3.1.dsc
 fda09ad6f1b0970b840908851e6019a5 71473 net optional jabber_1.4.3-3.1.diff.gz
 c6e4e43a413605edf7236edb5a48fe17 174216 net optional jabber_1.4.3-3.1_amd64.deb
 012952570b0edccfbd7e3660dabc315b 24888 devel optional jabber-dev_1.4.3-3.1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFl4cwmdOZoew2oYURAmntAJ0Q6zVT8H0oD3krd7JHEw6mTcmCqwCghQR+
aaLwp0L129UOzOYC1+XkPHk=
=cLsn
-----END PGP SIGNATURE-----

Changed in jabber:
status: Unconfirmed → Fix Released
Revision history for this message
ville palo (vi64pa) wrote :

From debian BTS: Fixed in version jabber/1.4.3-3.1 Fixed version is now in feisty.

Revision history for this message
William Grant (wgrant) wrote :

Fixed in Feisty.

Changed in jabber:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.