cURL / Mailing Lists / curl-library / Single Mail


Re: crash while receiving huge image data from server via POST

From: Jerry G. Chiuan <>
Date: Fri, 6 Feb 2004 15:34:42 -0800

sorry guys, I accidentally sent out unfinished email ^_*

> You need to provide more info for this to be interesting. What lines are
> these? Why does it crash on that line? Can you show us some content of
> variables?

Hi Daniel,
I tried to trace into curl codes and found it *always* crashes here:

CURLcode Curl_client_write( )
    if ( type & CLIENTWRITE_BODY) {
        wrote = data->set.fwrite(......) <--- this line

this is the call stack:
Curl_client_write( ) -- sendf.c
Curl_httpchunk_read( ) -- http_chunks.c
Curl_readwrite( ) --transfer.c
Transfer( ) -- transfer.c
Curl_perform( ) -- transfer.c
curl_easy_perform( ) -- easy.c

Here I would like to talk about what I found so far:

- my application needs to call Curl_readwrite( ) only once in order to fetch
JPEG image data from server
- Curl_httpchunk_read( ) gets called for every *chunked* data
- In each chunk, Curl_client_write( ) gets called for each so-called *piece*

In my case, it always crash within CURLcode Curl_client_write( ) for 15th
piece ( 558-byte one )
1st chunk: [146 bytes....]\r\n
2nd chunk: [8184 bytes....]\r\n[562 bytes....]
3rd chunk: [7622 bytes....]\r\n[8184 bytes....]\r\n[561 bytes....]
4th chunk: [7623 bytes....]\r\n[8184 bytes....]\r\n[560 bytes....]
5th chunk: [7624 bytes....]\r\n[8184 bytes....]\r\n[559 bytes....]
6th chunk: [7625 bytes....]\r\n[8184 bytes....]\r\n[558 bytes....]

^^^^^^^^^^^ crash within CURLcode Curl_client_write( , , ,558)
I will try to keep debuging it more detailedly

> How big is "big" and how small is "smaller"?

so far, at least I found it is ok for like 10k, but it crashes for 70k

> I really don't think this is related to the number of chunks.

I think so, but it is reproduceable in my case

> It would be really swell if you could provide some more details to allow
us to
> dig into the causes for this.

yes, certainly

thanks a lot
- Jerry
Received on 2004-02-07