[issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits)

2022-01-07 Thread Sam Gross
Change by Sam Gross : -- keywords: +patch pull_requests: +28673 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30470 ___ Python tracker <https://bugs.python.org/issu

[issue46205] Race condition in runtest_mp leads to hangs (never exits)

2021-12-30 Thread Sam Gross
Change by Sam Gross : -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue46205> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46205] Race condition in runtest_mp leads to hangs (never exits)

2021-12-30 Thread Sam Gross
Change by Sam Gross : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue46205> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue46205] Race condition in runtest_mp leads to hangs (never exits)

2021-12-30 Thread Sam Gross
New submission from Sam Gross : The runtest_mp.py has a race condition between checking for worker.is_alive() and processing the queue that can lead to indefinite hangs. The hang happens when the all the results from the self.output queue are processed but at least one of the workers hasn&#

[issue45838] Incorrect line numbers in GDB Python backtraces [3.9]

2021-11-18 Thread Sam Gross
Change by Sam Gross : -- keywords: +patch pull_requests: +27860 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29628 ___ Python tracker <https://bugs.python.org/issu

[issue45838] Incorrect line numbers in GDB Python backtraces [3.9]

2021-11-18 Thread Sam Gross
New submission from Sam Gross : Starting in Python 3.6 the line numbers table contains a *signed* byte indicating line delta. The calculation in Tools/gdb/libpython.py was not updated to handle signed bytes leading to incorrect line numbers when running "py-bt" (or printing fram

[issue45835] Race condition in test_queue can lead to test failures

2021-11-17 Thread Sam Gross
Change by Sam Gross : -- pull_requests: +27844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29601 ___ Python tracker <https://bugs.python.org/issu

[issue45835] Race condition in test_queue can lead to test failures

2021-11-17 Thread Sam Gross
Change by Sam Gross : -- keywords: +patch Added file: https://bugs.python.org/file50447/issue45835_repro.patch ___ Python tracker <https://bugs.python.org/issue45

[issue45835] Race condition in test_queue can lead to test failures

2021-11-17 Thread Sam Gross
New submission from Sam Gross : The test_queue suite has a race condition that can lead to test failures in test_many_threads, test_many_threads_nonblock, and test_many_threads_timeout. Consumers are signaled to exit by a sentinel value (None). The sentinel values are at the end of the input

[issue42540] Debug pymalloc crash when using os.fork() [regression]

2021-11-17 Thread Sam Gross
Change by Sam Gross : -- pull_requests: +27843 pull_request: https://github.com/python/cpython/pull/29600 ___ Python tracker <https://bugs.python.org/issue42

[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-11-15 Thread Sam Gross
Sam Gross added the comment: The `pthread_exit` behavior has been a problem for PyTorch and related libraries since Python 3.9. The PyTorch team has tried working around the problems without success (i.e. they keep getting bug reports involving crashes in PyEval_SaveThread/RestoreThread

[issue42540] Debug pymalloc crash when using os.fork() [regression]

2021-11-15 Thread Sam Gross
Change by Sam Gross : -- keywords: +patch nosy: +colesbury nosy_count: 2.0 -> 3.0 pull_requests: +27812 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29564 ___ Python tracker <https://bugs.python.org/i

[issue45809] Race condition in WeakKeyDictionary/WeakKeyDictionary

2021-11-15 Thread Sam Gross
Sam Gross added the comment: The attached patch (issue45809-repro.patch) introduces artificial delays to make reproduction of the underlying issue easier. To reproduce the issue: patch -p1 < issue45809-repro.patch ./python -m test test_weakref -m test_threaded_weak_value_dict_deepc

[issue45809] Race condition in WeakKeyDictionary/WeakKeyDictionary

2021-11-15 Thread Sam Gross
New submission from Sam Gross : The issue described issue7105 (and maybe issue7060) still exists due to a race condition in WeakKeyDictionary. This shows up as test failure that looks like: test test_weakref failed -- Traceback (most recent call last): File "Lib/test/test_weakr

[issue28737] Document that tp_dealloc handler must call PyObject_GC_UnTrack if Py_TPFLAGS_HAVE_GC is set

2021-10-27 Thread Sam Gross
Change by Sam Gross : -- pull_requests: +27513 pull_request: https://github.com/python/cpython/pull/29249 ___ Python tracker <https://bugs.python.org/issue28

[issue28737] Document that tp_dealloc handler must call PyObject_GC_UnTrack if Py_TPFLAGS_HAVE_GC is set

2021-10-27 Thread Sam Gross
Change by Sam Gross : -- keywords: +patch pull_requests: +27510 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29246 ___ Python tracker <https://bugs.python.org/issu

[issue28737] Document that tp_dealloc handler must call PyObject_GC_UnTrack if Py_TPFLAGS_HAVE_GC is set

2021-10-27 Thread Sam Gross
Sam Gross added the comment: Antoine Pitrou already fixed the "noddy4" example (now renamed to "custom4") and updated the newtypes_tutorial, but I think it's still worth mentioning PyObject_GC_Untrack in a few additional places. -- _

[issue28737] Document that tp_dealloc handler must call PyObject_GC_UnTrack if Py_TPFLAGS_HAVE_GC is set

2021-10-27 Thread Sam Gross
Change by Sam Gross : -- assignee: docs@python -> colesbury ___ Python tracker <https://bugs.python.org/issue28737> ___ ___ Python-bugs-list mailing list Un

[issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro

2021-07-16 Thread Sam Gross
Change by Sam Gross : -- type: enhancement -> behavior ___ Python tracker <https://bugs.python.org/issue44657> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro

2021-07-16 Thread Sam Gross
New submission from Sam Gross : The instancemethod_call function should use the PyInstanceMethod_GET_FUNCTION macro instead of the PyMethod_GET_FUNCTION macro. The current code is incorrect, but still works okay (doesn't crash) because PyInstanceMethodObject.func is at the same offs

[issue40120] Undefined C behavior going beyond end of struct via a char[1].

2020-03-31 Thread Sam Gross
Sam Gross added the comment: It may be worth considering C-API extensions written in C++. Flexible array members are not part of the C++ standard, although GCC, Clang, and MSVC support them as an extension. GCC and Clang will issue warnings with `-Wpedantic` and MSVC will issue warnings

[issue39571] clang warns "warning: redefinition of typedef 'PyTypeObject' is a C11 feature [-Wtypedef-redefinition]"

2020-02-06 Thread Sam Gross
Sam Gross added the comment: Yes, that fixes the warnings for me. Thanks! -- ___ Python tracker <https://bugs.python.org/issue39571> ___ ___ Python-bugs-list m

[issue39571] clang warns "warning: redefinition of typedef 'PyTypeObject' is a C11 feature [-Wtypedef-redefinition]"

2020-02-06 Thread Sam Gross
Sam Gross added the comment: Alternatively I think you can just remove the typedef from Include/cpython/object.h since Include/object.h is always included first. i.e.: typedef struct _typeobject { ... } PyTypeObject; to simply struct _typeobject

[issue39571] clang warns "warning: redefinition of typedef 'PyTypeObject' is a C11 feature [-Wtypedef-redefinition]"

2020-02-06 Thread Sam Gross
New submission from Sam Gross : A recent commit added a typedef for PyTypeObject in Include/object.h https://github.com/python/cpython/commit/0e4e735d06967145b49fd00693627f3624991dbc This duplicates the typedef in Include/cpython/object.h. Building with clang now issues a warning: ./Include

[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-07 Thread Sam Gross
New submission from Sam Gross : The implementation of weakref.proxy's methods call back into the Python API using a "borrowed reference" of the weakly referenced object (acquired via PyWeakref_GET_OBJECT). This API call may delete the last reference to the object (either dir

[issue28737] Document that tp_dealloc handler must call PyObject_GC_UnTrack if Py_TPFLAGS_HAVE_GC is set

2016-11-18 Thread Sam Gross
New submission from Sam Gross: In general, an a PyTypeObject that has Py_TPFLAGS_HAVE_GC set must call PyObject_GC_UnTrack() before it frees any PyObject* references it owns. The only reference to this requirement I found is in https://docs.python.org/3/c-api/gcsupport.html#c