cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl coredump in autobuild

From: Tor Arntsen <tor_at_spacetec.no>
Date: Fri, 29 Aug 2008 16:53:52 +0200

On Fri, Aug 29, 2008 at 15:34, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 29 Aug 2008, Tor Arntsen wrote:
>
>> Compiler: icc 9.1
>> Options: ./configure --with-ssl --disable-debug --disable-ipv6
>>
>> Tests are crashing, e.g. the first one:
>
> Gosh, and on x86 Debian too which I do all my primary development on!
>
> If you build current CVS curl manually with this setup, does it then crash
> like this? If so, can you run a simple command line with valgrind and see
> what it says?

Yes, done manually.
Unfortunately it doesn't say more than the gdb stacktrace does (this
is test 1, I have some more runs below):
==9065== Memcheck, a memory error detector.
==9065== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==9065== Using LibVEX rev 1606, a library for dynamic binary translation.
==9065== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==9065== Using valgrind-3.2.0-Debian, a dynamic binary instrumentation
framework.
==9065== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==9065== For more details, rerun with: -v
==9065==
--9065-- DWARF2 CFI reader: unhandled CFI instruction 0:7
* About to connect() to 127.0.0.1 port 8990 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8990 (#0)
> GET /verifiedserver HTTP/1.1
> User-Agent: curl/7.19.0-CVS (i686-pc-linux-gnu) libcurl/7.19.0-CVS OpenSSL/0.9.8g zlib/1.2.3.3 libidn/0.6.5 libssh2/0.18
> Host: 127.0.0.1:8990
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 16
<
{ [data not shown]
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
==9065== Invalid read of size 4
==9065== at 0x403400A: Curl_freeaddrinfo (hostip.c:565)
==9065== Address 0x6A99004 is not stack'd, malloc'd or (recently) free'd
==9065==
==9065== Process terminating with default action of signal 11
(SIGSEGV): dumping core
==9065== Access not within mapped region at address 0x6A99004
==9065== at 0x403400A: Curl_freeaddrinfo (hostip.c:565)
==9065==
==9065== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 57 from 1)
==9065== malloc/free: in use at exit: 65,259 bytes in 2,037 blocks.
==9065== malloc/free: 2,098 allocs, 61 frees, 75,093 bytes allocated.
==9065== For counts of detected errors, rerun with: -v
==9065== searching for pointers to 2,037 not-freed blocks.
==9065== checked 571,080 bytes.
==9065==
==9065== LEAK SUMMARY:
==9065== definitely lost: 0 bytes in 0 blocks.
==9065== possibly lost: 0 bytes in 0 blocks.
==9065== still reachable: 65,259 bytes in 2,037 blocks.
==9065== suppressed: 0 bytes in 0 blocks.
==9065== Reachable blocks (those to which a pointer was found) are not shown.
==9065== To see them, rerun with: --show-reachable=yes
Segmentation fault

o The above was with the Intel compiler, icc 9.1
(--with-ssl (or --without-ssl) --disable-debug --disable-ipv6)

o It does _not_ fail with gcc 4.2.3.

o It fails the same way with both icc 9.1 and icc 10.0)

o It does _not_ fail if I use --enable-debug instead of --disable-debug
o It does _not_ fail if I build with CFLAGS="-O0 -g" (i.e. optimizations off)
o In those cases where it doesn't fail (e.g. -O0), a valgrind run doesn't
indicate any problems either.

Tricky.

Other valgrind dumps:
$ valgrind ../src/.libs/lt-curl -I http://localhost/
==12731== Memcheck, a memory error detector.
==12731== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==12731== Using LibVEX rev 1606, a library for dynamic binary translation.
==12731== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==12731== Using valgrind-3.2.0-Debian, a dynamic binary
instrumentation framework.
==12731== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==12731== For more details, rerun with: -v
==12731==
--12731-- DWARF2 CFI reader: unhandled CFI instruction 0:7
HTTP/1.1 200 OK
Date: Fri, 29 Aug 2008 14:49:33 GMT
Server: Apache/2.2.3 (Debian) PHP/4.4.4-9
Last-Modified: Mon, 24 Sep 2007 16:29:17 GMT
ETag: "6a-770-1f2f7140"
Accept-Ranges: bytes
Content-Length: 1904
Content-Type: text/html; charset=UTF-8

==12731== Invalid read of size 4
==12731== at 0x40312DA: Curl_freeaddrinfo (hostip.c:565)
==12731== Address 0x6170C04 is not stack'd, malloc'd or (recently) free'd
==12731==
==12731== Process terminating with default action of signal 11
(SIGSEGV): dumping core
==12731== Access not within mapped region at address 0x6170C04
==12731== at 0x40312DA: Curl_freeaddrinfo (hostip.c:565)
==12731==
==12731== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 55 from 1)
==12731== malloc/free: in use at exit: 35,312 bytes in 25 blocks.
==12731== malloc/free: 108 allocs, 83 frees, 51,896 bytes allocated.
==12731== For counts of detected errors, rerun with: -v
==12731== searching for pointers to 25 not-freed blocks.
==12731== checked 422,200 bytes.
==12731==
==12731== LEAK SUMMARY:
==12731== definitely lost: 0 bytes in 0 blocks.
==12731== possibly lost: 0 bytes in 0 blocks.
==12731== still reachable: 35,312 bytes in 25 blocks.
==12731== suppressed: 0 bytes in 0 blocks.
==12731== Reachable blocks (those to which a pointer was found) are not shown.
==12731== To see them, rerun with: --show-reachable=yes
Segmentation fault

$ valgrind ../src/.libs/lt-curl ftp://ftp/
==12763== Memcheck, a memory error detector.
==12763== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==12763== Using LibVEX rev 1606, a library for dynamic binary translation.
==12763== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==12763== Using valgrind-3.2.0-Debian, a dynamic binary
instrumentation framework.
==12763== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==12763== For more details, rerun with: -v
==12763==
--12763-- DWARF2 CFI reader: unhandled CFI instruction 0:7
==12763== Invalid read of size 4
==12763== at 0x403FA4E: ftp_init (ftp.c:3019)
==12763== Address 0x6171808 is not stack'd, malloc'd or (recently) free'd
==12763==
==12763== Process terminating with default action of signal 11
(SIGSEGV): dumping core
==12763== Access not within mapped region at address 0x6171808
==12763== at 0x403FA4E: ftp_init (ftp.c:3019)
==12763==
==12763== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 57 from 1)
==12763== malloc/free: in use at exit: 36,995 bytes in 42 blocks.
==12763== malloc/free: 101 allocs, 59 frees, 51,076 bytes allocated.
==12763== For counts of detected errors, rerun with: -v
==12763== searching for pointers to 42 not-freed blocks.
==12763== checked 423,592 bytes.
==12763==
==12763== LEAK SUMMARY:
==12763== definitely lost: 0 bytes in 0 blocks.
==12763== possibly lost: 0 bytes in 0 blocks.
==12763== still reachable: 36,995 bytes in 42 blocks.
==12763== suppressed: 0 bytes in 0 blocks.
==12763== Reachable blocks (those to which a pointer was found) are not shown.
==12763== To see them, rerun with: --show-reachable=yes
Segmentation fault

(gdb):
Program terminated with signal 11, Segmentation fault.
#0 0x0403fa4e in ftp_init (conn=0x4699078) at ftp.c:3019
3019 ftp = (struct FTP *)calloc(sizeof(struct FTP), 1);
(gdb) where
#0 0x0403fa4e in ftp_init (conn=0x4699078) at ftp.c:3019
#1 0x0403abf7 in ftp_connect (conn=0x4699078, done=0x4044cf8
"\203\b\205t\b\027E") at ftp.c:3067
#2 0x04044cf8 in Curl_protocol_connect (conn=0x46a20c8,
protocol_done=0x4044a60 "\203\b\205u\a\207\001\001") at url.c:2842
#3 0x04044a60 in setup_conn (conn=0x4061197, hostaddr=0x6171808,
protocol_done=0x303c1 <Address 0x303c1 out of bounds>) at url.c:4449
#4 0x0404255c in Curl_connect (data=0x4699078, in_connect=0xbe9f24bc,
asyncp=0xbe9f2494 "", protocol_done=0xbe9f2498 "") at url.c:4525
#5 0x0404d49d in connect_host (data=0x4061197, conn=0x6171808) at
transfer.c:2357
#6 0x0404a903 in Curl_perform (data=0x4699078) at transfer.c:2438
#7 0x0404d856 in curl_easy_perform (curl=0x804bd65) at easy.c:530
#8 0x0804bd65 in operate (config=0x4061197, argc=102176776,
argv=0x303c1) at main.c:4792
#9 0x0804a432 in main (argc=2, argv=0xbe9f2b34) at main.c:5098

-Tor
Received on 2008-08-29