[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread STINNER Victor

STINNER Victor added the comment:

I don't plan to send a pull request to the Python 3.5 release manager.
This bug existed since Python 3.0, the fix can wait for Python 3.5.1.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Yi Ding

Yi Ding added the comment:

Thank you everyone! I will test the next rc of 3.5.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread STINNER Victor

STINNER Victor added the comment:

> @haypo, yeah, definitely better than mine! All good for me.

Ok. I added your name to Misc/ACKS. I had to do some tricks to apply the patch 
to Python 3.4 (code was in Python/pythonrun.c) and then to merge to Python 3.5 
(code moved to Python/pylifecycle.c). But I checked the fix in each version 
using gdb:

* put a breakpoint on create_stdio,
* type "print close(0)" after the first is_valid_fd() check,
* see that the open() exception is correctly handled (type "next", "next", ... 
and check that we go to the error: label and then enter the if() block)

Thanks for your patch Marco.

I prefer to be extra safe by checking the raised exception to minimize the risk 
of regression.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e67bf9c9a898 by Victor Stinner in branch '3.4':
Fix race condition in create_stdio()
https://hg.python.org/cpython/rev/e67bf9c9a898

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Marco Paolini

Marco Paolini added the comment:

@haypo, yeah, definitely better than mine! All good for me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread STINNER Victor

STINNER Victor added the comment:

> This new issue24891_2.patch covers all of the points you raised except the 
> "check exception type" which I am still figuring out.

See my patch issue24891_3.patch which calls 
PyErr_ExceptionMatches(PyExc_OSError). If you like it, I can push it to Python 
3.4-3.6.

--
Added file: http://bugs.python.org/file40357/issue24891_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Marco Paolini

Marco Paolini added the comment:

@haypo thanks for the quick review. This new issue24891_2.patch covers all of 
the points you raised except the "check exception type" which I am still 
figuring out.

--
Added file: http://bugs.python.org/file40355/issue24891_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Yes, it looks like a good approach. Some comments:

- please mention this issue "Issue #24891"  and explain the issue in a
comment in create_stdio_checked()
- it would be safer to check the exception type, to be extra safe
- you must clear the exception
- why not putting the code in create_stdio() directly?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Marco Paolini

Changes by Marco Paolini :


Removed file: http://bugs.python.org/file40353/issue24891.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Marco Paolini

Marco Paolini added the comment:

ops wrong patch... trying again.

--
Added file: http://bugs.python.org/file40354/issue24891.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-04 Thread Marco Paolini

Marco Paolini added the comment:

Attaching a patch. Does it make any sense?

--
keywords: +patch
nosy: +mpaolini
Added file: http://bugs.python.org/file40353/issue24891.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-09-01 Thread Yi Ding

Yi Ding added the comment:

I'm not sure this is a race condition. There's a crash every single time python 
is started when running the test.sh script under nohup.

If it's a race condition, it should only happen some of the time, not every 
single time.

Can you reeevaluate the priority?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Interpreter Core -Macintosh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24891] race condition in initstdio() (python aborts running under nohup)

2015-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: python aborts running under nohup -> race condition in initstdio() 
(python aborts running under nohup)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com