Ask Your Question

does malloc blocks signals? [closed]

asked 2012-11-05 12:38:02 -0500

M4nti5 gravatar image

updated 2014-09-30 11:29:55 -0500

mether gravatar image

Hi all, can somebody please point me to some documentation that specifies the behaviour of a thread that's calling malloc when a signal arrives in fedora 15?

Is the signal handler called regardless of the execution point?, or is the call deferred?

I tried to read about thes in the man and google, but I haven't find any information so far about this topic.

Thanks in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by FranciscoD_
close date 2013-08-13 07:55:50.735387


Not really a Fedora question. I'd recommend looking at a programming forum. The malloc implementation should be the same in all linux variants. I'd recommend updating to Fedora 19. Fedora 15 is way too old and contains outdated software which could suffer from bugs and security risks.

FranciscoD_ gravatar imageFranciscoD_ ( 2013-08-13 07:55:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-12 13:52:15 -0500

rstrode gravatar image

malloc does not block signals. This is why malloc is not a signal-safe function, and why it's not "legal" to allocate memory from a signal handler. The signal handler is called immediately from a random thread with no protection against reentrancy.

man 7 signal talks about this somewhat i believe.

edit flag offensive delete link more

Question Tools


Asked: 2012-11-05 12:38:02 -0500

Seen: 75 times

Last updated: Aug 12 '13