New submission from Xinmeng Xia <xi...@smail.nju.edu.cn>:

See the following 'test.py', we call client.makepasv() in socket, and then 
create_connection. Recursively calling makepasv() finally leads to core dumped.

System: Python 3.10.1, 3.11.0a3 ,master on Ubuntu 18.04
  
Reproduce step: 
1. executing "python test.py"
2. If only TimeoutError is observed, just executing this code again. Maybe 
after 4 or 5 times, this program crashes Python interpreter.


test.py
===============================================
import socket
from test.test_ftplib import TestFTPClass,TIMEOUT

def test_makepasv():
    host, port = TestFTPClass.client.makepasv()
    conn = socket.create_connection((test_makepasv(), host), timeout=TIMEOUT)
    conn.close()
===============================================

Error Message:
---------------------------------------------------
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/asyncore.py", line 
90, in read
    obj.handle_read_event()
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/asyncore.py", line 
427, in handle_read_event
Traceback (most recent call last):
.....
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/test/test_ftplib.py", 
line 298, in run
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out
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=0x0000556df3cfbe30)

Current thread 0x00007fb82ce69080 (most recent call first):
  <no Python frame>

Extension modules: _testcapi (total: 1)
Aborted (core dumped)
-----------------------------------------------------

----------
components: Library (Lib)
messages: 409408
nosy: xxm
priority: normal
severity: normal
status: open
title: Recursively calling makepasv() finally leads to core dumped.
type: crash
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46211>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to