This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients dino.viehland, eric.snow, pablogsal, twouters
Date 2020-01-16.15:57:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579190228.02.0.184799498557.issue38076@roundup.psfhosted.org>
In-reply-to
Content
Executing this simple code after this commit segfaults:

from multiprocessing.pool import Pool
class A(object):
    def __init__(self):
        self.pool = Pool()
    def __del__(self):
        self.pool.close()
        self.pool.join()
a = A()

[1]    28019 segmentation fault  ./python.exe ../lel.py

The reason is that there is a call to PyModule_GetState with the module being NULL:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x00000001000b9737 python.exe`PyModule_GetState(m=0x0000000000000000) at moduleobject.c:565:10
    frame #1: 0x00000001013d5972 _struct.cpython-39d-darwin.so`s_pack(self=0x00000001032fae50, args=0x00000001033051f8, nargs=1) at _struct.c:1858:5
    frame #2: 0x00000001013d4a8a _struct.cpython-39d-darwin.so`pack(self=0x00000001013be890, args=0x00000001033051f0, nargs=2) at _struct.c:2165:14
    frame #3: 0x00000001000b6e5d python.exe`cfunction_vectorcall_FASTCALL(func=0x00000001013beb30, args=0x00000001033051f0, nargsf=9223372036854775810, kwnames=0x0000000000000000) at methodobject.c:380:24
    frame #4: 0x00000001001efa89 python.exe`_PyObject_Vectorcall(callable=0x00000001013beb30, args=0x00000001033051f0, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #5: 0x00000001001efbfa python.exe`call_function(tstate=0x0000000101003ec0, pp_stack=0x00007ffeefbf6e60, oparg=2, kwnames=0x0000000000000000) at ceval.c:4984:13
    frame #6: 0x00000001001ea00c python.exe`_PyEval_EvalFrameDefault(f=0x0000000103305050, throwflag=0) at ceval.c:3465:23
    frame #7: 0x00000001001d8c87 python.exe`PyEval_EvalFrameEx(f=0x0000000103305050, throwflag=0) at ceval.c:737:12
    frame #8: 0x000000010004374e python.exe`function_code_fastcall(co=0x0000000103165380, args=0x0000000103301400, nargs=2, globals=0x0000000103131d10) at call.c:293:14
    frame #9: 0x000000010004317a python.exe`_PyFunction_Vectorcall(func=0x000000010324d910, stack=0x00000001033013f0, nargsf=9223372036854775810, kwnames=0x0000000000000000) at call.c:331:20
    frame #10: 0x00000001001efa89 python.exe`_PyObject_Vectorcall(callable=0x000000010324d910, args=0x00000001033013f0, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #11: 0x00000001001efbfa python.exe`call_function(tstate=0x0000000101003ec0, pp_stack=0x00007ffeefbf8950, oparg=2, kwnames=0x0000000000000000) at ceval.c:4984:13
    frame #12: 0x00000001001ea09c python.exe`_PyEval_EvalFrameDefault(f=0x0000000103301250, throwflag=0) at ceval.c:3482:23
    frame #13: 0x00000001001d8c87 python.exe`PyEval_EvalFrameEx(f=0x0000000103301250, throwflag=0) at ceval.c:737:12
    frame #14: 0x00000001001f126c python.exe`_PyEval_EvalCodeWithName(_co=0x0000000103159930, globals=0x0000000103131d10, locals=0x0000000000000000, args=0x00000001032b2f68, argcount=2, kwnames=0x0000000000000000, kwargs=0x00000001032b2f78, kwcount=0, kwstep=1, defs=0x0000000103173f18, defcount=2, kwdefs=0x0000000000000000, closure=0x0000000000000000, name=0x000000010315c2e0, qualname=0x0000000103158430) at ceval.c:4296:14
    frame #15: 0x00000001000435d0 python.exe`_PyFunction_Vectorcall(func=0x000000010324d230, stack=0x00000001032b2f68, nargsf=9223372036854775810, kwnames=0x0000000000000000) at call.c:356:12
    frame #16: 0x00000001001efa89 python.exe`_PyObject_Vectorcall(callable=0x000000010324d230, args=0x00000001032b2f68, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #17: 0x00000001001efbfa python.exe`call_function(tstate=0x0000000101003ec0, pp_stack=0x00007ffeefbfa610, oparg=2, kwnames=0x0000000000000000) at ceval.c:4984:13
    frame #18: 0x00000001001ea09c python.exe`_PyEval_EvalFrameDefault(f=0x00000001032b2de0, throwflag=0) at ceval.c:3482:23
    frame #19: 0x00000001001d8c87 python.exe`PyEval_EvalFrameEx(f=0x00000001032b2de0, throwflag=0) at ceval.c:737:12
    frame #20: 0x000000010004374e python.exe`function_code_fastcall(co=0x00000001031d5860, args=0x0000000103302fd8, nargs=2, globals=0x00000001031d1b90) at call.c:293:14
    frame #21: 0x000000010004317a python.exe`_PyFunction_Vectorcall(func=0x0000000103256b90, stack=0x0000000103302fc8, nargsf=9223372036854775810, kwnames=0x0000000000000000) at call.c:331:20
    frame #22: 0x00000001001efa89 python.exe`_PyObject_Vectorcall(callable=0x0000000103256b90, args=0x0000000103302fc8, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #23: 0x00000001001efbfa python.exe`call_function(tstate=0x0000000101003ec0, pp_stack=0x00007ffeefbfc100, oparg=2, kwnames=0x0000000000000000) at ceval.c:4984:13
    frame #24: 0x00000001001ea09c python.exe`_PyEval_EvalFrameDefault(f=0x0000000103302e50, throwflag=0) at ceval.c:3482:23
    frame #25: 0x00000001001d8c87 python.exe`PyEval_EvalFrameEx(f=0x0000000103302e50, throwflag=0) at ceval.c:737:12
    frame #26: 0x000000010004374e python.exe`function_code_fastcall(co=0x000000010177aee0, args=0x0000000103306380, nargs=1, globals=0x00000001012a97d0) at call.c:293:14
    frame #27: 0x000000010004317a python.exe`_PyFunction_Vectorcall(func=0x0000000103252410, stack=0x0000000103306378, nargsf=9223372036854775809, kwnames=0x0000000000000000) at call.c:331:20
    frame #28: 0x00000001001efa89 python.exe`_PyObject_Vectorcall(callable=0x0000000103252410, args=0x0000000103306378, nargsf=9223372036854775809, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #29: 0x00000001001efbfa python.exe`call_function(tstate=0x0000000101003ec0, pp_stack=0x00007ffeefbfdbf0, oparg=1, kwnames=0x0000000000000000) at ceval.c:4984:13
    frame #30: 0x00000001001ea09c python.exe`_PyEval_EvalFrameDefault(f=0x0000000103306200, throwflag=0) at ceval.c:3482:23
    frame #31: 0x00000001001d8c87 python.exe`PyEval_EvalFrameEx(f=0x0000000103306200, throwflag=0) at ceval.c:737:12
    frame #32: 0x000000010004374e python.exe`function_code_fastcall(co=0x0000000101251930, args=0x00007ffeefbfed20, nargs=1, globals=0x0000000101155b30) at call.c:293:14
    frame #33: 0x000000010004317a python.exe`_PyFunction_Vectorcall(func=0x00000001032535f0, stack=0x00007ffeefbfed18, nargsf=9223372036854775809, kwnames=0x0000000000000000) at call.c:331:20
    frame #34: 0x00000001000ec5b9 python.exe`_PyObject_Vectorcall(callable=0x00000001032535f0, args=0x00007ffeefbfed18, nargsf=9223372036854775809, kwnames=0x0000000000000000) at abstract.h:106:21
    frame #35: 0x00000001000ec422 python.exe`_PyObject_CallOneArg(func=0x00000001032535f0, arg=0x00000001012afc80) at abstract.h:144:12
    frame #36: 0x00000001000ec36a python.exe`call_unbound_noarg(unbound=1, func=0x00000001032535f0, self=0x00000001012afc80) at typeobject.c:1462:16
    frame #37: 0x00000001000e8220 python.exe`slot_tp_finalize(self=0x00000001012afc80) at typeobject.c:6815:15
    frame #38: 0x00000001002932ff python.exe`finalize_garbage(collectable=0x00007ffeefbfee38) at gcmodule.c:866:13
    frame #39: 0x000000010028fcd3 python.exe`collect(state=0x0000000100427890, generation=2, n_collected=0x0000000000000000, n_uncollectable=0x0000000000000000, nofail=1) at gcmodule.c:1098:5
    frame #40: 0x000000010028f9a9 python.exe`_PyGC_CollectNoFail at gcmodule.c:1851:13
    frame #41: 0x000000010022ff1c python.exe`_PyImport_Cleanup(tstate=0x0000000101003ec0) at import.c:560:5
    frame #42: 0x000000010025298e python.exe`Py_FinalizeEx at pylifecycle.c:1232:5
    frame #43: 0x000000010028d88d python.exe`Py_RunMain at main.c:648:9
    frame #44: 0x000000010028dc69 python.exe`pymain_main(args=0x00007ffeefbff080) at main.c:676:12
    frame #45: 0x000000010028dcb7 python.exe`Py_BytesMain(argc=2, argv=0x00007ffeefbff0f0) at main.c:700:12
    frame #46: 0x0000000100001482 python.exe`main(argc=2, argv=0x00007ffeefbff0f0) at python.c:16:12
    frame #47: 0x00007fff75bff3d5 libdyld.dylib`start + 1


I am marking this as a release blocked
History
Date User Action Args
2020-01-16 15:57:08pablogsalsetrecipients: + pablogsal, twouters, dino.viehland, eric.snow
2020-01-16 15:57:08pablogsalsetmessageid: <1579190228.02.0.184799498557.issue38076@roundup.psfhosted.org>
2020-01-16 15:57:07pablogsallinkissue38076 messages
2020-01-16 15:57:07pablogsalcreate