{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/886","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/886/comments","events_url":"https://api.github.com/repos/curl/curl/issues/886/events","html_url":"https://github.com/curl/curl/issues/886","id":161109626,"number":886,"title":"libcurl crashes at fwrite() when I upload a file","user":{"login":"JackChen255","id":12280750,"avatar_url":"https://avatars.githubusercontent.com/u/12280750?v=3","gravatar_id":"","url":"https://api.github.com/users/JackChen255","html_url":"https://github.com/JackChen255","followers_url":"https://api.github.com/users/JackChen255/followers","following_url":"https://api.github.com/users/JackChen255/following{/other_user}","gists_url":"https://api.github.com/users/JackChen255/gists{/gist_id}","starred_url":"https://api.github.com/users/JackChen255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackChen255/subscriptions","organizations_url":"https://api.github.com/users/JackChen255/orgs","repos_url":"https://api.github.com/users/JackChen255/repos","events_url":"https://api.github.com/users/JackChen255/events{/privacy}","received_events_url":"https://api.github.com/users/JackChen255/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/curl/curl/labels/crash","name":"crash","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-20T03:12:31Z","updated_at":"2016-06-20T11:50:28Z","closed_at":null,"body":"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\r\n\r\nWhat I called:\r\nWriteCallbackStatic(void *contents, size_t size, size_t nmemb, void *userp);\r\ncurl_easy_setopt(curl_data.m_lib_curl_handle_ptr, CURLOPT_READFUNCTION, WriteCallbackStatic);\r\ncurl_easy_setopt(curl_data.m_lib_curl_handle_ptr, CURLOPT_READDATA, userdata);\r\n\r\nStack trace:\r\n(gdb) bt\r\n#0  0x00007ffff604741a in fwrite () from /lib64/libc.so.6\r\n#1  0x00007fffec8713f3 in Curl_client_write () from libcurl.so\r\n#2  0x00007fffec8851b7 in Curl_readwrite () from libcurl.so\r\n#3  0x00007fffec885ea7 in ?? () from libcurl.so\r\n#4  0x00007fffec886a28 in Curl_perform () from libcurl.so\r\n#5  0x00007fffec8873c6 in curl_easy_perform () from libcurl.so\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/227121322","html_url":"https://github.com/curl/curl/issues/886#issuecomment-227121322","issue_url":"https://api.github.com/repos/curl/curl/issues/886","id":227121322,"user":{"login":"JackChen255","id":12280750,"avatar_url":"https://avatars.githubusercontent.com/u/12280750?v=3","gravatar_id":"","url":"https://api.github.com/users/JackChen255","html_url":"https://github.com/JackChen255","followers_url":"https://api.github.com/users/JackChen255/followers","following_url":"https://api.github.com/users/JackChen255/following{/other_user}","gists_url":"https://api.github.com/users/JackChen255/gists{/gist_id}","starred_url":"https://api.github.com/users/JackChen255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackChen255/subscriptions","organizations_url":"https://api.github.com/users/JackChen255/orgs","repos_url":"https://api.github.com/users/JackChen255/repos","events_url":"https://api.github.com/users/JackChen255/events{/privacy}","received_events_url":"https://api.github.com/users/JackChen255/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T11:50:28Z","updated_at":"2016-06-20T11:50:28Z","body":"@jay Thanks, I will print the curl version when I back to office. The WriteCallbackStatic is actually the call back function for READFUNCTION. I change it to ReadCallbackStatic. The problem is that the call back function is not called. My breakpoint in GDB at this function is never hit."}}
{"actor":{"display_login":"JackChen255"}}