cURL / Mailing Lists / curl-library / Single Mail


Signal handling issues with libcurl ?

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


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
- 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
- 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.

Received on 2008-11-05