cURL / Mailing Lists / curl-library / Single Mail


libcurl 7.21.1 assertion in transfer.c:read_rewind(struct connectdata *conn, size_t thismuch)

From: Ron Parker <>
Date: Mon, 23 Aug 2010 11:37:16 -0400

Hello, all.

I am seeing an assertion which appears to be a case where a chunked response is processed and a rewind is attempted, but a master_buffer has not been allocated.
Has anyone else observed this behavior?


   Ron Parker
   Movik Networks

My multi-threaded program using libcurl is compiled with:

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --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.2 --program-suffix=-4.2 --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.2.4 (Ubuntu 4.2.4-1ubuntu4)

The core file backtrace:

(gdb) bt
#0 0x00007fd29916d095 in raise () from /lib/
#1 0x00007fd29916eaf0 in abort () from /lib/
#2 0x00007fd2991662df in __assert_fail () from /lib/
#3 0x00000000004414a4 in read_rewind (conn=0x14088f58, thismuch=5)
    at ../../../curl-7.21.1/lib/transfer.c:331
#4 0x0000000000441cae in readwrite_data (data=0x140800e8, conn=0x14088f58,
    k=0x14080110, didwhat=0x40f4be34, done=0x40f4bed3)
    at ../../../curl-7.21.1/lib/transfer.c:599
#5 0x0000000000442882 in Curl_readwrite (conn=0x14088f58, done=0x40f4bed3)
    at ../../../curl-7.21.1/lib/transfer.c:1007
#6 0x0000000000417db9 in multi_runsingle (multi=0x11f22ba8, easy=0x13fc5588)
    at ../../../curl-7.21.1/lib/multi.c:1334
#7 0x0000000000418e9a in multi_socket (multi=0x11f22ba8, checkall=false,
    s=16, ev_bitmask=1, running_handles=0x77eae0)
    at ../../../curl-7.21.1/lib/multi.c:1950
#8 0x000000000041949d in curl_multi_socket_action (multi_handle=0x11f22ba8,
    s=16, ev_bitmask=1, running_handles=0x77eae0)
    at ../../../curl-7.21.1/lib/multi.c:2074

And some select members of the connectdata structure...

(gdb) p ((struct connectdata *)0x14088f58)->read_pos
$3 = 0
(gdb) p ((struct connectdata *)0x14088f58)->master_buffer
$4 = 0x0
(gdb) p ((struct connectdata *)0x14088f58)->buf_len
$5 = 0

List admin:
Received on 2010-08-23