curl-users
RE: couple of stack dumps for 7.10-pre2
Date: Fri, 13 Sep 2002 14:36:33 -0400
-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Friday, September 13, 2002 4:07 AM
DS: > #4 Curl_disconnect (conn=0x100ddc98) at url.c:1113
DS: This is the free(conn->proto.generic) one, right?
Correct.
DS: When using HTTP, that block is allocated at http.c:495 (in my copy)
DS: but it assigns the proto.http pointer (it is a union).
DS: Can you set a break-point and see if the same pointer is stored in
DS: there at the malloc() time that is later free()d?
They are the same. I tried both with and without -DMALLOCDEBUG.
In today's test with -DMALLOCDEBUG, the mem pointer was set to
0x100de788 at malloc() time, with mem->mem (aka conn->proto.http)
set to 0x100de790:
0x100de788: 0x0000004c 0x00000248 0xa5a5a5a5 0xa5a5a5a5 ...
At free() time, conn->proto.generic was still set to 0x100de790:
0x100de788: 0x0000004c 0x00000248 0x00000000 0x00000000
0x100de798: 0x0043c6a7 0x0043c6d0 0x00000342 0x00000000
0x100de7a8: 0x00000000 0x00000000 0x00000000 0x00000000
0x100de7b8: 0x00000000 0x00000000 0x00000000 0x00000000
0x100de7c8: 0x00000000 0x00000000 0x00000000 0x00000000
0x100de7d8: 0x00000000
0x100de7dc: 0xa5a5a5a5 0xa5a5a5a5 0x00000039 0x00000020
Notice that there's a couple of remaining a5a5a5a5's at the end! After
returning from curl_domalloc, http.c:498 zero's out the memory, but it
doesn't quite zero ALL of it...
When curl_domalloc allocated the memory, it grabbed 92 bytes, which
is 76 (0x4c) + 16, and set all 92 to 0xa5. Then it pointed mem->mem
at the 9th byte (mem + 8) and returned it as conn->proto.http, when
76 bytes (up through 76+8=84) were zeroed out, but the last 8 bytes
(85 through 92) were left at 0xa5a5a5a5, and they were still set to
0xa5a5a5a5 at the free() time.
Don't know if that's related (remember I have this same problem without
-DMALLOCDEBUG), but thought I'd pass it along...
--Kevin
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-13