libcurl3-gnutls has memory corruption

Bug #379477 reported by Peter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curl (Debian)
Fix Released
Unknown
curl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hello!
 I'm using libcurl-7.18.2 with GNU-TLS, with curl_multi_* interface. I'm not using share handles. When i start my program on server with high bandwidth rate, with a large amount of network streams, libcurl causes memory corruption.
 I've wrote simple testcase(libcurl_bug_testcase.c), that reproduces programs behaviour. Don't worry about irrational usage of curl_easy_setopt, this is done to duplicate behaviour of my apllication, which is much more complex then this testcase. Also i'm attaching links set, with which bug appears(links.txt).
 When i run testcase under valgrind, in 80 network streams, there is memory corruption in libcurl. There is invalid write of 4 bytes in multi_runsingle (multi.c:907), which causes magic behaviour. You can see it in attachment(valgrind_error_log.txt). If i run testcase without valgrind, memory corruption results in segmentation fault.
 I checked this testcase with libcurl-7.19.5 and it seems, that bug is fixed in it(i configured it with folowing options: --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt --without-ssl --with-gnutls --without-libssh2).

 My system info:
    uname -a
        Linux * 2.6.27-14-generic #1 SMP Wed Apr 15 18:59:16 UTC 2009 i686 GNU/Linux

    lsb_release -ar
        No LSB modules are available.
        Distributor ID: Ubuntu
        Description: Ubuntu 8.10
        Release: 8.10
        Codename: intrepid

    aptitude show libcurl3-gnutls
        Package: libcurl3-gnutls
        State: installed
        Automatically installed: yes
        Version: 7.18.2-1ubuntu4.3
        Priority: optional
        Section: libs
        Maintainer: Ubuntu Core Developers <email address hidden>
        Uncompressed Size: 418k
        Depends: libc6 (>= 2.4), libcomerr2 (>= 1.01), libgcrypt11 (>= 1.4.0), libgnutls26 (>= 2.4.0-0), libidn11 (>= 0.5.18), libkrb53 (>= 1.6.dfsg.2),
                 libldap-2.4-2 (>= 2.4.7), libtasn1-3 (>= 0.3.4), zlib1g (>= 1:1.1.4), ca-certificates
        Conflicts: libcurl4-gnutls
        Replaces: libcurl4-gnutls
        Description: Multi-protocol file transfer library (GnuTLS)
         libcurl is designed to be a solid, usable, reliable and portable multi-protocol file transfer library.

         SSL support is provided by GnuTLS.

         This is the shared version of libcurl.
        Homepage: http://curl.haxx.se

    gcc -v
        Using built-in specs.
        Target: i486-linux-gnu
        Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
        Thread model: posix
        gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

 Attachments:
    libcurl_bug_testcase.c - testcase, that reproduces memory corruption.
    links.txt - file with links, that should be passed to testcase.
    valgrind_error_log.txt - valgrind output on my server/desktop.

  With best regards, Piter Smith.

Related branches

Revision history for this message
Peter (pasalam79) wrote :
Revision history for this message
Rilium (rilium) wrote :

This bug also affect's me(i have Ubuntu Jaunty), and also exists in Debian lenny
I've wroten about it here: http://curl.haxx.se/mail/lib-2009-04/0394.html, and later mailed private mail to Daniel Stenberg, but he didn't answered me.

Changed in curl (Debian):
status: Unknown → New
Revision history for this message
Daniel Stenberg (daniel-haxx) wrote :

First, I don't need private email about curl bugs. We deal with them on the curl mailing lists just fine. But I do respond to private emails unless they accidentally get caught in my spam box, which I then presume your (Rilium) email did.

Then, as this bug is mentioned to already be fixed in a later release, I'm not very interested in chasing after it in old releases.

Revision history for this message
Rilium (rilium) wrote :

Daniel
Sorry, that i mail'ed you privately, i did it this way, to not show publically some information.

2Ubuntu developers
Can i hope that libcurl version availible in ubuntu repositaries will be fixed? Can i do something to help in it?

Revision history for this message
Daniel Stenberg (daniel-haxx) wrote :

7.19.5 is about to show up in debian any minute now, so I figure ubuntu should be able to keep up as well

Changed in curl (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package curl - 7.19.5-1ubuntu1

---------------
curl (7.19.5-1ubuntu1) karmic; urgency=low

  * Merge from Debian unstable (LP: #380281), remaining changes:
    - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
    - Add build-dependency on openssh-server
    - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
    - Call automake-1.9 with --add-missing --copy --force
  * Fixes LP: #379477

curl (7.19.5-1) unstable; urgency=low

  * New upstream release
  * Fix "libcurl3-gnutls has memory corruption" by upgrading to new upstream
    release, which fixes this bug (Closes: #530131)
  * update standards version to 3.8.1
  * adjust overrides from libdevel to debug for -dbg package
  * adjust doc-base section

 -- Bhavani Shankar <email address hidden> Tue, 26 May 2009 18:58:51 +0530

Changed in curl (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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