curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

curl crashes when internet switched off

From: Salman Ahmed via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 4 Sep 2019 16:22:54 +0500

Hello,

I am facing this problem where my application just terminates when I
manually switch off my WiFi while it is waiting on curl_easy_perform() in a
separate thread from the main thread.

Thread 4 "my-app" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7fffebfff700 (LWP 27283)]
0x00007ffff75364bd in write () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) backtrace
#0 0x00007ffff75364bd in write () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007ffff6772455 in ?? () from
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#2 0x00007ffff677047c in BIO_write () from
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#3 0x00007ffff6ac9bf2 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#4 0x00007ffff6acbe13 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#5 0x00007ffff6ac7a22 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#6 0x00007ffff7bbb6e3 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#7 0x00007ffff7b89717 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#8 0x00007ffff7b8a12a in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#9 0x00007ffff7b9e99f in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#10 0x00007ffff7b9ef5d in curl_multi_perform () from
/usr/lib/x86_64-linux-gnu/libcurl.so.4
#11 0x00007ffff7b95a0b in curl_easy_perform () from
/usr/lib/x86_64-linux-gnu/libcurl.so.4
#12 0x0000000000405942 in my_curl_loop ()
#13 0x00007ffff752d6ba in start_thread (arg=0x7fffebfff700) at
pthread_create.c:333
#14 0x00007ffff726341d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

I see that in my_curl_loop() , I am successfully able to call
curl_easy_perform() and block there. But as soon as I switch off my
internet , my app terminates without even returning from curl_easy_perform.

Any one got any ideas?

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-09-04