cURL / Mailing Lists / curl-library / Single Mail

curl-library

Signal handling issues with libcurl ?

From: Hassan Shaik <hshaik_at_arcot.com>
Date: Wed, 5 Nov 2008 06:34:07 -0800

Hi,

Following is the problem scenario:

- Native C library that makes of libcurl for HTTP/HTTPS communication
- We have a JNI and java API around this library, for providing Java API
support
- We have a java code using the above Java API and within this code, we
have signal handler (using sun.misc.SignalHandler) for SIGPIPE.
- Before invoking native code (which internally calls libcurl API), this
signal handler works fine and JVM does not crash when SIGPIPE signal is
raised.
- But, once the native code is called, the Java signal handler is not
working and not catching SIGPIPE any more. JVM just crashes. Looks like,
it is set to SIG_DFL.

Is libcurl modifies the signal handling behavior and does not restore
back to the original signal handling behavior of the application?

I read through about CURLOPT_NOSIGNAL option. Does setting this flag to
1 help anyway?

Appreciate your help and early responses on this.

Thanks a lot.

Regards,
Hassan
Received on 2008-11-05