Subject: libgloox7: Too short receive timeout causes gloox to busy wait
Package: libgloox7
Version: 0.9.9.5-1.2
Severity: normal
Tags: patch

In ConnectionTCPBase::receive(), there is a line:

while( !m_cancel && ( err = recv( 10 ) ) == ConnNoError )

This is a timeout of 10 microseconds, which causes recv() to immediately timeout and in fact busy-wait, uselessly eating significant amount of CPU time. More sane timeout value should be used.

Bug can be solved with following small patch or by updating the package to version in upstream SVN branch 1.0, where this is already fixed.


--- gloox-0.9.9.5/src/connectiontcpbase.cpp     2008-04-26 13:47:24.000000000 
+0200
+++ connectiontcpbase.cpp       2009-12-27 02:40:39.940853288 +0100
@@ -107,7 +107,7 @@
       return ConnNotConnected;

     ConnectionError err = ConnNoError;
-    while( !m_cancel && ( err = recv( 10 ) ) == ConnNoError )
+    while( !m_cancel && ( err = recv( 1000000 ) ) == ConnNoError )
       ;
     return err == ConnNoError ? ConnNotConnected : err;
   }



-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgloox7 depends on:
ii  libc6                  2.10.2-2          GNU C Library: Shared libraries
ii  libgcc1                1:4.4.2-3         GCC support library
ii  libgnutls26            2.8.5-2           the GNU TLS library - runtime libr
ii  libidn11               1.15-2            GNU Libidn library, implementation
ii  libstdc++6             4.4.2-3           The GNU Standard C++ Library v3
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

libgloox7 recommends no packages.

libgloox7 suggests no packages.

-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to