I am using curl_easy_perform to transfer a file from one node to another. During the transfer, the process is crashing and generating the below core file:
#0 0x00007f5c4af74301 in poll () from /lib64/libc.so.6
#1 0x00007f5c4be0c7b8 in ssh_poll_ctx_dopoll () from /lib64/libssh.so.4
#2 0x00007f5c4be0d890 in ssh_handle_packets () from /lib64/libssh.so.4
#3 0x00007f5c4be0d95d in ssh_handle_packets_termination () from /lib64/libssh.so.4
#4 0x00007f5c4bdf0d04 in ssh_channel_read_timeout () from /lib64/libssh.so.4
#5 0x00007f5c4be1b384 in sftp_packet_read () from /lib64/libssh.so.4
#6 0x00007f5c4be1b7b0 in sftp_read_and_dispatch () from /lib64/libssh.so.4
#7 0x00007f5c4be1f538 in sftp_open () from /lib64/libssh.so.4
#8 0x00007f5c4c08a2d0 in myssh_statemach_act () from /lib64/libcurl.so.4
#9 0x00007f5c4c08bd0a in myssh_multi_statemach () from /lib64/libcurl.so.4
#10 0x00007f5c4c080ab0 in multi_runsingle () from /lib64/libcurl.so.4
#11 0x00007f5c4c081b41 in curl_multi_perform () from /lib64/libcurl.so.4
#12 0x00007f5c4c07842b in curl_easy_perform () from /lib64/libcurl.so.4
Code is as below:
m_curl_http_handle = curl_easy_init();
curl_easy_setopt(m_curl_handle,CURLOPT_URL, m_remote_url.c_str());
headerlist = curl_slist_append(headerlist, post_cmd.c_str());
headerlist = curl_slist_append(headerlist, remoteFilePerm.c_str());
curl_easy_setopt(m_curl_handle, CURLOPT_POSTQUOTE, headerlist);
curl_easy_setopt(m_curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(m_curl_handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(m_curl_handle, CURLOPT_READDATA, hd_src);
curl_easy_setopt(m_curl_handle, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize);
curl_easy_setopt(m_curl_handle,CURLOPT_CONNECTTIMEOUT,timeout);
CURLcode result = curl_easy_perform(m_curl_handle);
As seen above, curl_easy_perform is called with the curl handle. In which case does the curl_multi_perform gets invoked? what is the reason for the crash?
The issue is sporadic in nature. Any help is appreciated.