Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: malloc crash

by dpuu (Chaplain)
on Dec 25, 2002 at 07:25 UTC ( [id://222166]=note: print w/replies, xml ) Need Help??


in reply to malloc crash

You don't show any code, so I'll answer using generalities.

As a general rule, you should do as little as possible in a signal handler. Typical actions would be to set a flag (which will be detected in the mainline code), or to increment a semaphore (to wake up a thread -- to continue processing). --Dave

Replies are listed 'Best First'.
Re: Re: malloc crash
by Nygeve (Acolyte) on Dec 25, 2002 at 07:49 UTC
    So there is neither any magic "i want safe signals" option no newest signals safe version of perl?
    I didn't post any code because i think this is a general problem: simple daemon that updates mysql db once per 10 sec using alarm signal.
      I didn't post any code because i think this is a general problem: simple daemon that updates mysql db once per 10 sec using alarm signal.

      That's like saying "I didn't post any code, because it's just a little CGI that does some stuff and prints HTML" ... the devil is in the details.

      As a general rule: If you have a question about why some code doesn't do what you expect. Post the code (or the smallest sample program that demonstrates the problem).

      In situations where your question concerns an err msg you are getting, the "general rule" becomes the golden rule: If you are getting an eror, from code you think should work, post a sample program that generates the error, and the exact text of the error, along with your question.

        "As a general rule: If you have a question about why some code doesn't do what you expect. Post the code (or the smallest sample program that demonstrates the problem)."
        Ok, agree. But i must say that this question is not about one piece of code that doesn't want to work. This question is about common problem in perl(sorry) - signals and malloc(you can of course call it more smartly, kinda low level interaction of perl and cpp methods or what ever). I saw questions from people about this(google,you know e.t.c.), but (i)didn't find any clear answer. So i didn't want to bother anyone with the another snippet with the same problem. Just wanted a quick answer(help).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://222166]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found