Crash in signal handling in Jobs.py
Brian Quistorff <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAAEVvsC1r18SZ6qgsQMA-tomwSeMmhAr3zKb6Fe=iPKs12HdwQ@mail.gmail.com> |
Hello, Thanks all for the wonderful tool. My scons crashes in situations where there is a signal handler registered from "outside Python" (the phrase used in the Python docs for signal.signal). This happens for me when I run scons from inside Stata (a stats program), which embeds Python, and sets up a signal handler. I think this could also happen if one runs scons from a Python environment where a compiled plugin registered a signal handler. I tracked the problem to Jobs.py, where _setup_sig_handler() retrieves the previous signal handler (signal.signal() returns None in this case) and then in _reset_sig_handler() it tries to the set the signal handler to this previous (None) value. None is not allowed and this causes a crash. I've coded up a patch that resets the signal handler to signal.SIG_DFL (the default handler) when the previous one was None and warns the user that this is happening. I'm looking for feedback, to see if this is an acceptable fix, and if/how I should proceed on GitHub. Thanks, Brian _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users