curl-library
core dump AIX on curl_easy_cleanup
Date: Sat, 30 Oct 2004 23:18:13 -0600
am getting a core dump on curl_easy cleanup when using the latest
version of libcurl on aix.
Following is the code:
chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
chunk.size = 0; /* no data at this point */
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1);
/*curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION,writeHeaderBuf );*/
curl_easy_setopt(curl_handle, CURLOPT_URL, uri);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
curl_easy_perform(curl_handle);
/*now copy this to our structure*/
memcpy(pLargeString.pLargeBinString, chunk.memory, chunk.size);
pLargeString.len = chunk.size;
free(chunk.memory);
curl_easy_cleanup(curl_handle);
code is exactly similar to the one provided in samples for getting
data into memory in the samples
Also I looked at http://curl.haxx.se/mail/lib-2002-10/0132.html which
has similar problem. tried using the configure options mentioned in
that thread, but didnt quite understand the resolution of the problem
in that thread.
And here is the call stack from dbx:
Type 'help' for help.
reading symbolic information ...
[using memory image in core]
Segmentation fault in rightmost at 0xd01f2f10 ($t1)
0xd01f2f10 (rightmost+0xc) 80e5000c lwz r7,0xc(r5)
(dbx) where
rightmost(??, ??) at 0xd01f2f10
free_y(??, ??) at 0xd01f46a4
free(??) at 0xd01e51dc
Also sometimes I get
Segmentation fault in splay at 0xd016b924
0xd016b924 (splay+0xa8) 81870004 l r12,0x4(r7)
(dbx) where
splay(??, ??, ??) at 0xd016b924
free_y(??, ??) at 0xd016cf98
free(??) at 0xd016b124
Another thing is that it doest occur everytime I try the same request.
But one in about 4 or 5 times.
Any ideas?
Thanks,
-Sachin
Received on 2004-11-01