nyk has asked for the wisdom of the Perl Monks concerning the following question:

I am experimenting to write a little search engine in perl. It uses mysql tables as "stacks" for the URLs it has to visit on the curent level, for the links it found to the next level and for storing CRCs of visited URLs. I do test runs with a version running 10 parallel threads.

After some minutes it suddently terminates with this strange message:
Alarm clock

But I didn't request such a feature! What can I do or did I do wrong? What kind of things cause this error and program termination? If I knew that, it would make fixing the program a lot easier. Thanks for any help!

I used these perl modules: DBI, threads, threads::shared, all newest versions from portage.

If you would like to look at the code:
http://pastebin.com/392151

Replies are listed 'Best First'.
Re: "Alarm clock" termination
by dave_the_m (Monsignor) on Oct 13, 2005 at 12:30 UTC
    Something in your code (or in a module you use) is calling the alarm() function without setting an alarm signal handler:
    $ perl587 -we'alarm(1); 1 while 1' Alarm clock $ $ perl587 -we'$SIG{ALRM}="IGNORE";alarm(1); 1 while 1' (hangs indefinitey)

    Dave.

      Thanks a lot for the info, I'll of course try to ignore the signal and hope my program wont hang also instead. :) But what could be a cause for the alarm signal?
        But what could be a cause for the alarm signal?
        To repeat what I just said: Something in your code (or in a module you use) is calling the alarm() function.

        This function sets up a condition whereby after the number of seconds specified, an ALRM signal is sent to the process.

        Dave.