]> granicus.if.org Git - python/commit
Rewrite eintr_tester.py to avoid os.fork()
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Sep 2015 23:38:44 +0000 (01:38 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Sep 2015 23:38:44 +0000 (01:38 +0200)
commitbe923ac948635e1a93d55398648f8d03996d3ebd
treeffd2fa596709b4e1ddd460793aa73c32bf37cf9a
parent5a682c9ca5b5f0ea3e2d5e2b02fc1a5304c501a2
Rewrite eintr_tester.py to avoid os.fork()

eintr_tester.py calls signal.setitimer() to send signals to the current process
every 100 ms. The test sometimes hangs on FreeBSD. Maybe there is a race
condition in the child process after fork(). It's unsafe to run arbitrary code
after fork().

This change replace os.fork() with a regular call to subprocess.Popen(). This
change avoids the risk of having a child process which continue to execute
eintr_tester.py instead of exiting. It also ensures that the child process
doesn't inherit unexpected file descriptors by mistake.

Since I'm unable to reproduce the issue on FreeBSD, I will have to watch
FreeBSD buildbots to check if the issue is fixed or not.

Remove previous attempt to debug: remove call to
faulthandler.dump_traceback_later().
Lib/test/eintrdata/eintr_tester.py