[New-bugs-announce] [issue42717] The python interpreter crashed with "_enter_buffered_busy"
Xinmeng Xia
report at bugs.python.org
Tue Dec 22 05:25:03 EST 2020
New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:
The following program can work well in Python 2. However it crashes in Python 3( 3.6-3.10 ) with the following error messages.
Program:
============================================
import sys,time, threading
class test:
def test(self):
pass
class test1:
def run(self):
for i in range(0,10000000):
connection = test()
sys.stderr.write(' =_= ')
def testrun():
client = test1()
thread = threading.Thread(target=client.run, args=())
thread.setDaemon(True)
thread.start()
time.sleep(0.1)
testrun()
============================================
Error message:
------------------------------------------------------------------------------
=_= =_= =_= =_= =_= ...... =_= =_= =_= =_=
Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0xd0c180)
Current thread 0x00007f08a638f700 (most recent call first):
<no Python frame>
Aborted (core dumped)
------------------------------------------------------------------------------
When I remove "time.sleep(0.1)" or "thread.setDaemon(True)" or "sys.stderr.write(' =_= ')" or "for i in range(0,10000000)":, the python interpreter seems to work well.
----------
components: Interpreter Core
messages: 383582
nosy: xxm
priority: normal
severity: normal
status: open
title: The python interpreter crashed with "_enter_buffered_busy"
type: crash
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42717>
_______________________________________
More information about the New-bugs-announce
mailing list