Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

infinite loop in unix SIGCHLD handler #68

Closed
GoogleCodeExporter opened this issue Apr 10, 2015 · 9 comments
Closed

infinite loop in unix SIGCHLD handler #68

GoogleCodeExporter opened this issue Apr 10, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link


https://codereview.appspot.com/14142043/

What steps will reproduce the problem?
./test_sigchld_loop.py

What is the expected output?
first 1.0
second 2.0
third 3.0
end 4.0


Original issue reported on code.google.com by a...@free.fr on 30 Sep 2013 at 6:41

Attachments:

@GoogleCodeExporter
Copy link
Author

I think this was fixed by Nikolay's latest (rev d27bbaf93422).

But please test it for yourself.

Original comment by gvanrossum@gmail.com on 15 Oct 2013 at 8:12

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

yes it is, but I think the fix introduces a race condition. The while loop 
should not be removed (POSIX signals are not queued).

Original comment by a...@free.fr on 16 Oct 2013 at 10:59

@GoogleCodeExporter
Copy link
Author

hmm, i dont see a race condition. Could you explain more?

Original comment by fafhr...@gmail.com on 16 Oct 2013 at 2:19

@GoogleCodeExporter
Copy link
Author

If two children terminate in the same time, SIGCHLD may be raised only once.

This condition can be triggered easily when running some code through the C API 
because the signal handler is called only after the C function returns.

The attached script demonstrates it.

With 44e4c8257a9d it outputs:
  first finished 3.0
  second finished 3.0
  end 4.0

With d27bbaf93422 it outputs:
  first finished 3.0
  end 4.0
(the termination of the second process not reported)

Original comment by a...@free.fr on 19 Oct 2013 at 10:29

Attachments:

@GoogleCodeExporter
Copy link
Author

OK, reopening.

Could it be that this is also causing the buildbot failures that are being 
reported?  E.g. http://bugs.python.org/issue19294

Original comment by gvanrossum@gmail.com on 19 Oct 2013 at 3:45

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

to me it looks unrelated because test_subprocess_shell starts only one 
subprocess

Original comment by a...@free.fr on 19 Oct 2013 at 5:46

@GoogleCodeExporter
Copy link
Author

I believe this was fixed in CPython by 
http://hg.python.org/cpython/rev/28397ecf2316 . Please verify that your latest 
test works with CPython 3.4alpha4 (replace tulip with asyncio in the test) -- 
it has a dependency that I haven't got.

I will port that fix to the Tulip repo once things settle a bit.

Original comment by gvanrossum@gmail.com on 20 Oct 2013 at 11:49

@GoogleCodeExporter
Copy link
Author

I confirm. Both tests work well now

Original comment by a...@free.fr on 21 Oct 2013 at 5:17

@GoogleCodeExporter
Copy link
Author

Thanks! Closing again. (The Tulip port has happened.)

Original comment by gvanrossum@gmail.com on 21 Oct 2013 at 5:59

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant