-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Description
Currently the critical section held assertions on objects are not helpful as it doesn't prints the object of which the critical section should be held, it is helpful for debugging to print the object along with a message that critical section of object is not held.
Before:
❯ ./python -m test test_asyncio
Using random seed: 3111514708
0:00:00 load avg: 21.32 Run 34 tests sequentially in a single process
0:00:00 load avg: 21.32 [ 1/34] test_asyncio.test_base_events
python: ./Include/internal/pycore_critical_section.h:236: void _PyCriticalSection_AssertHeld(PyMutex *): Assertion `cs != NULL && cs->_cs_mutex == mutex' failed.
Fatal Python error: Aborted
After:
./python -m test test_asyncio
Using random seed: 3608858608
0:00:00 load avg: 0.25 Run 34 tests sequentially in a single process
0:00:00 load avg: 0.25 [ 1/34] test_asyncio.test_base_events
./Include/internal/pycore_critical_section.h:259: _PyCriticalSection_AssertHeldObj: Assertion "(cs != ((void*)0) && cs->_cs_mutex == mutex)" failed: Critical section of object is not held
Enable tracemalloc to get the memory block allocation traceback
object address : 0x20000566ce0
object refcount : 3
object type : 0x20000f74610
object type name: _asyncio.Task
object repr : <Task pending name='Task-118' coro=<BaseEventLoop._create_server_getaddrinfo() running at /home/realkumaraditya/cpython/Lib/asyncio/base_events.py:1500>>
Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)