Python core dump on sys.exit() from signal handler
问题 I am seeing python core dump for a seemingly harmless program. I have written following piece of code to demonstrate my problem: proc = None def __signalHandler(signum, frame): print "In __signalHandler" if proc is not None: print "Send signal to BG proc" os.killpg(os.getpgid(proc.pid), signal.SIGINT) print "Wait for it to finish" proc.communicate() print "sys exit" sys.exit(130) signal.signal(signal.SIGINT, __signalHandler) # Start the process proc = subprocess.Popen(["a.out"], stdout