curl-and-python

Re: "Previous alarm fired off!" then Segmentation fault

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 20 Jun 2008 13:09:18 +0200 (CEST)

On Fri, 20 Jun 2008, ??? wrote:

> however,when the code run ,there is a error "Previous alarm fired off!"

This is a message from libcurl.

If you have a libcurl built and made to use signals for timeouts, libcurl will
set handle its own timeout with the use of signals. When it does this, it
first remembers the time left for SIGALRM when libcurl changes it. Then when
libcurl is done, it restores the previous SIGALRM time-out but with the
elapsed time deducted.

In your case, the "previous timeout - elapsed time" turned negative and thus:
a previous alarm fired off. libcurl will then set alarm() to signal in 1
second (as that's the lowest time it can set using that function call) and
return CURLE_OPERATION_TIMEDOUT.

Why or how the alarm was set when libcurl got control I cannot answer.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2008-06-20