samedi 20 avril 2019

c++ Stop libcurl crypto throwing Signals

I have a c++ 11 program and am using libcurl with the curl_easy wrappers to contact a remote server. I am using SSL, have set the CURLOPT_NO_SIGNAL to stop curl from throwing signals and also recompiled curl with cares. However I still get the following signal thrown by the underlying ssl library.

/main(_Z13signalHandleri+0x464) [0x65230]
/lib/libc.so.6(__default_sa_restorer_v2+0) [0x40d3ae50]
/lib/libcrypto.so.1.0.0(+0xb400c) [0x4090c00c]
/lib/libcrypto.so.1.0.0(lh_retrieve+0x1c) [0x4090c614]
/lib/libcrypto.so.1.0.0(+0xb71c0) [0x4090f1c0]
/lib/libcrypto.so.1.0.0(ERR_get_state+0x48) [0x409103bc]
/lib/libcrypto.so.1.0.0(+0xb8a84) [0x40910a84]
/lib/libcrypto.so.1.0.0(ERR_peek_last_error+0x28) [0x40910cb0]
/lib/libcrypto.so.1.0.0(PEM_X509_INFO_read_bio+0x3d4) [0x4093e9cc]
/lib/libcrypto.so.1.0.0(X509_load_cert_crl_file+0x54) [0x40950720]
/lib/libcrypto.so.1.0.0(+0xf8880) [0x40950880]
/lib/libcrypto.so.1.0.0(X509_LOOKUP_ctrl+0x34) [0x4094d57c]
/lib/libcrypto.so.1.0.0(X509_STORE_load_locations+0x48) [0x409455e8]
/lib/libcurl.so.4(+0x3b9a4) [0x40a189a4]
/lib/libcurl.so.4(+0x3d3e8) [0x40a1a3e8]
/lib/libcurl.so.4(+0xd3dc) [0x409ea3dc]
/lib/libcurl.so.4(+0x184b0) [0x409f54b0]
/lib/libcurl.so.4(+0x275b0) [0x40a045b0]
/lib/libcurl.so.4(curl_multi_perform+0x6c) [0x40a051f0]
/lib/libcurl.so.4(curl_easy_perform+0xdc) [0x409fdfd4]

I have tried wrapping the curl_easy_perform with a try/catch but for some reason it doesnt seem to catch the signal

try
   {
      curl_easy_perform()
   }
   catch (int signal)
    {

    }
    catch (...)
    {

    }

Aucun commentaire:

Enregistrer un commentaire