[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Would be great to merge this in 3.7.0.  The change is super safe to merge.

The 3.7rc1 is not supposed to be tagged on the current 3.7 branch?

--
nosy: +vstinner

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread Yury Selivanov


Yury Selivanov  added the comment:

Would be great to merge this in 3.7.0.  The change is super safe to merge.

--
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread miss-islington

miss-islington  added the comment:


New changeset 51d0a2c8ddcb9f58d71ff0a62be4e31a1af3f139 by Miss Islington (bot) 
in branch '3.7':
bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ 
(GH-7080)
https://github.com/python/cpython/commit/51d0a2c8ddcb9f58d71ff0a62be4e31a1af3f139


--
nosy: +miss-islington

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6788

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6787

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 35230d08e09de4e2e52658d5cb09e5b0ca965418 by Yury Selivanov in 
branch 'master':
bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ (#7080)
https://github.com/python/cpython/commit/35230d08e09de4e2e52658d5cb09e5b0ca965418


--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

There's nothing specific here to uvloop except the fact that it was compiled 
with Cython, so module finalization/GC pattern is slightly different to that of 
vanilla asyncio.

Serhiy, I'm merging this PR since I'd like to avoid having segfaults in 3.7.0.  
Feel free to debug this further.

--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-28 Thread Peter Bašista

Peter Bašista  added the comment:

> Can this crash be reproduced without uvloop?
I am not aware of a way to reproduce this without uvloop.

> What is the backtrace of the assertion failure?
Without uvloop, the following exception is raised:

Exception ignored in: >
Traceback (most recent call last):
  File "uvloop_test.py", line 13, in __del__
  File "/usr/lib/python3.6/asyncio/base_events.py", line 276, in create_future
AttributeError: 'NoneType' object has no attribute 'Future'

With uvloop and with Python compiled with --with-pydebug configure option, the 
failed assertion is mentioned in the original uvloop bug report. In particular, 
this assertion fails:

python3.6-dbg: ../Objects/abstract.c:2300: _PyObject_FastCallDict: Assertion 
`func != NULL' failed. 

A full GDB backtrace is attached.

--
nosy: +pbasista
Added file: https://bugs.python.org/file47619/uvloop-test.gdb-backtrace.txt

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is okay if the fact that half of the objects are freed leads to raising 
exceptions. But an assertion failure is sign of bugs in Python core or the 
_asyncio module. PR 7080 removes one way of exposing these bugs, but bugs 
itself still are here, and there may be other ways of triggering a crash.

Can this crash be reproduced without uvloop? What is the backtrace of the 
assertion failure?

--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Then we should find what callable is NULL and fix the place where it is 
> called. _PyObject_FastCallDict() should never be called with NULL.

My understanding is that the interpreter is being shutdown and half of the 
objects are freed. We're still holding a reference to *something* in Python 
space and try calling it.  The obvious fix for that is simply avoid capturing 
tracebacks if a Future object is created during finalization of the interpreter 
(it's pointless to capture it anyways at that point).

--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Then we should find what callable is NULL and fix the place where it is called. 
_PyObject_FastCallDict() should never be called with NULL.

--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Is the problem because traceback_extract_stack is NULL?

It's not NULL, it's just a broken reference at that point.

--

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is the problem because traceback_extract_stack is NULL?

But this will not fix the problem completely. For example calling repr() on a 
future can crash because of asyncio_future_repr_info_func == NULL. And many 
other operations use globals cleared in module_free().

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Yury Selivanov

Change by Yury Selivanov :


--
type:  -> crash

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Yury Selivanov

Change by Yury Selivanov :


--
components: +asyncio
nosy: +asvetlov

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Yury Selivanov

Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +6710
stage:  -> patch review

___
Python tracker 

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



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-23 Thread Yury Selivanov

New submission from Yury Selivanov :

Originally reported in https://github.com/MagicStack/uvloop/issues/143

Future.__init__ shouldn't try to capture the current traceback if the 
interpreter is being finalized.

--
messages: 317437
nosy: yselivanov
priority: normal
severity: normal
status: open
title: Fix possible SIGSGV when asyncio.Future is created in __del__
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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