Thanks to visit codestin.com
Credit goes to github.com

Skip to content

libcurl crashes at fwrite() when I upload a file #886

@JackChen255

Description

@JackChen255

I want to use libcurl to chunked upload a file to remote Http server. I call below functions to set READDATA and READFUNCTION to register callback parameters. But libcurl still crashes during curl_easy_perform(). Could anyone help on it? Thanks

What I called:
ReadCallbackStatic(void *contents, size_t size, size_t nmemb, void *userp);
curl_easy_setopt(curl_data.m_lib_curl_handle_ptr, CURLOPT_READFUNCTION, ReadCallbackStatic);
curl_easy_setopt(curl_data.m_lib_curl_handle_ptr, CURLOPT_READDATA, userdata);

Stack trace:
(gdb) bt
#0 0x00007ffff604741a in fwrite () from /lib64/libc.so.6
#1 0x00007fffec8713f3 in Curl_client_write () from libcurl.so
#2 0x00007fffec8851b7 in Curl_readwrite () from libcurl.so
#3 0x00007fffec885ea7 in ?? () from libcurl.so
#4 0x00007fffec886a28 in Curl_perform () from libcurl.so
#5 0x00007fffec8873c6 in curl_easy_perform () from libcurl.so

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions