You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the curl_easy interfaces in 2 threads, and immediately call curl_easy_setopt(curl, CURLOPT_NOSIGNAL);. Eventually, in curl_easy_cleanup the instances are destroyed, where unfortunately sigaction(SIGPIPE, &action, NULL); is called and in our case due to race condition this keeps the SIG_IGN installed if both destructions happen at almost the same time.
Here is the relevant stacktrace:
#0 0xfffffd7fff082824 in sigaction () from /lib/64/libc.so.1
#1 0x000000000095837a in sigpipe_ignore (ig=ig@entry=0xfffffd7ffe6001e0, data=<optimized out>) at sigpipe.h:51
#2 0x0000000000958ee9 in sigpipe_ignore (data=<optimized out>, ig=0xfffffd7ffe6001e0) at conncache.c:604
#3 Curl_conncache_close_all_connections (connc=connc@entry=0x12d0738) at conncache.c:597
#4 0x0000000000952220 in curl_multi_cleanup (multi=0x12d0640) at multi.c:2219
#5 0x000000000096ff8d in Curl_close (data=data@entry=0x12c6f70) at url.c:326
#6 0x000000000094e797 in curl_easy_cleanup (data=0x12c6f70) at easy.c:832
I expected the following
sigaction()should never be called when we use curl_easy_setopt(curl, CURLOPT_NOSIGNAL);
@martinus: I just put the assignment in another place, next to two other options that also get "inherited" by the closure handle. I'll appreciate if you can just verify that this also works for you. See #3147!
Activity
martinus commentedon Oct 15, 2018
I have a small patch that seems to work for us:
I'm not sure though if that is the best place to do this.
bagder commentedon Oct 16, 2018
Thanks for the report, I think you're entirely correct and I'll give your suggested a fix a closer look...
bagder commentedon Oct 18, 2018
@martinus: I just put the assignment in another place, next to two other options that also get "inherited" by the closure handle. I'll appreciate if you can just verify that this also works for you. See #3147!
martinus commentedon Oct 19, 2018
I've just tried this your fix and it works for us. Thanks!
bagder commentedon Oct 19, 2018
Excellent, thanks for confirming!