logoalt Hacker News

nine_ktoday at 3:47 AM2 repliesview on HN

POSIX signals are broken by design, alas: https://lwn.net/Articles/414618/

Python or not, almost nothing is safe inside a signal handler.


Replies

knometoday at 4:01 AM

the first line of the article points out that python isn't run in the POSIX C handler. that just sets a flag for the interpreter to act on. the python issue is an unsafe re-entrant handling strategy in the interpreter.

inigyoutoday at 4:31 AM

Certain signals are true user-mode interrupts, like SIGTERM and some of the ones glibc uses to implement pthreads.

The ones related to application logic must only be handled with signalfd if you want any semblance of reliability.