[issue40965] Segfault when importing unittest module via C API

2020-06-22 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-40294.

Right, please upgrade to Python 3.8.3 which includes the fix.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Use-after-free crash if multiple interpreters import asyncio 
module

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-22 Thread The Comet


The Comet  added the comment:

Thanks for the input! I should have been more specific. I was running python 
3.8.2 when I got this segfault.

I upgraded to 3.8.3 and the issue is no longer present, so it seems this has 
already been fixed.

--

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

Fix was here:

a75e730075 bpo-40294: Fix _asyncio when module is loaded/unloaded multiple 
times (GH-19542)

Backport commit was:
6b0ca0aeab04d7b7b54086248ca9d5e70f770f2f

>From my end, the issue seems to be resovled on tag v.3.8.3

--

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

I was able to reproduce, follows is the raw LLDB output, I don't think this 
fails on master, will try some bisecting:

* thread #1, name = 'runtest', stop reason = signal SIGSEGV: invalid address 
(fault address: 0x0)
frame #0: 0x77079ae7 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio [inlined] 
_Py_INCREF(op=0x) at object.h:459:18
   456  static inline void _Py_INCREF(PyObject *op)
   457  {
   458  _Py_INC_REFTOTAL;
-> 459  op->ob_refcnt++;
   460  }
   461  
   462  #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op))
(lldb) bt
* thread #1, name = 'runtest', stop reason = signal SIGSEGV: invalid address 
(fault address: 0x0)
  * frame #0: 0x77079ae7 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio [inlined] 
_Py_INCREF(op=0x) at object.h:459:18
frame #1: 0x77079ad6 
_asyncio.cpython-38d-x86_64-linux-gnu.so`PyInit__asyncio at 
_asynciomodule.c:3405
frame #2: 0x55720766 
runtest`_PyImport_LoadDynamicModuleWithSpec(spec=0x76e33780, 
fp=) at importdl.c:164:9
frame #3: 0x5571e471 
runtest`_imp_create_dynamic_impl(module=, spec=0x76e33780, 
file=) at import.c:2220:11
frame #4: 0x5571e60b 
runtest`_imp_create_dynamic(module=0x776ec830, args=0x76e336f8, 
nargs=1) at import.c.h:330:20
frame #5: 0x55645fbe 
runtest`cfunction_vectorcall_FASTCALL(func=0x77753050, 
args=0x76e336f8, nargsf=, kwnames=0x) at 
methodobject.c:421:24
frame #6: 0x556042ca 
runtest`PyVectorcall_Call(callable=0x77753050, tuple=, 
kwargs=) at call.c:199:24
frame #7: 0x55604771 runtest`PyCFunction_Call(func=, 
args=, kwargs=) at call.c:774:12
frame #8: 0x556eabf0 
runtest`do_call_core(tstate=0x5593f3c0, func=0x77753050, 
callargs=0x76e336e0, kwdict=0x76e20ad0) at ceval.c:5007:9
frame #9: 0x556f8897 
runtest`_PyEval_EvalFrameDefault(f=0x559fa330, throwflag=) 
at ceval.c:3559:22
frame #10: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #11: 0x556ecd40 
runtest`_PyEval_EvalCodeWithName(_co=0x77725860, globals=, 
locals=, args=, argcount=2, 
kwnames=0x, kwargs=0x776bf5b0, kwcount=0, kwstep=1, 
defs=0x, defcount=0, kwdefs=0x, 
closure=0x, name=0x7792fdd0, 
qualname=0x7792fdd0) at ceval.c:4298:14
frame #12: 0x55601dbd 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:435:12
frame #13: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775810, 
args=0x776bf5a0, callable=0x77763b90) at abstract.h:127:11
frame #14: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff79a0, 
oparg=, kwnames=0x) at ceval.c:4987
frame #15: 0x556f834c 
runtest`_PyEval_EvalFrameDefault(f=0x776bf410, throwflag=) 
at ceval.c:3469:23
frame #16: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #17: 0x5560134e 
runtest`function_code_fastcall(co=, args=0x77fa63a0, 
nargs=2, globals=) at call.c:283:14
frame #18: 0x55601eb6 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:410:20
frame #19: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775810, 
args=0x77fa6390, callable=0x776eaa50) at abstract.h:127:11
frame #20: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff7b80, 
oparg=, kwnames=0x) at ceval.c:4987
frame #21: 0x556f8296 
runtest`_PyEval_EvalFrameDefault(f=0x77fa6210, throwflag=) 
at ceval.c:3486:23
frame #22: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at ceval.c:741:12
frame #23: 0x5560134e 
runtest`function_code_fastcall(co=, args=0x55a18ef8, 
nargs=1, globals=) at call.c:283:14
frame #24: 0x55601eb6 
runtest`_PyFunction_Vectorcall(func=, stack=, 
nargsf=, kwnames=) at call.c:410:20
frame #25: 0x556eb811 runtest`call_function [inlined] 
_PyObject_Vectorcall(kwnames=0x, nargsf=9223372036854775809, 
args=0x55a18ef0, callable=0x777624b0) at abstract.h:127:11
frame #26: 0x556eb79f 
runtest`call_function(tstate=0x5593f3c0, pp_stack=0x7fff7d68, 
oparg=, kwnames=0x) at ceval.c:4987
frame #27: 0x556f83d4 
runtest`_PyEval_EvalFrameDefault(f=0x55a18d70, throwflag=) 
at ceval.c:3500:19
frame #28: 0x556ec25a runtest`PyEval_EvalFrameEx(f=, 
throwflag=) at 

[issue40965] Segfault when importing unittest module via C API

2020-06-20 Thread Steve Stagg


Steve Stagg  added the comment:

This appears to have been  introduced in 13915a3100 bpo-36356: Fix memory leak 
in _asynciomodule.c (GH-16598).

Cannot reproduce on master

--

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-16 Thread Christian Heimes


Christian Heimes  added the comment:

It would be helpful if you could provide a C stacktrace. I use gdb to create a 
stacktrace. You may have to install additional debug symbols.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-15 Thread Brett Cannon


Change by Brett Cannon :


--
title: Segfault when importing unittest module -> Segfault when importing 
unittest module via C API

___
Python tracker 

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