You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] Segmentation fault when pyarrow is imported in exit handler #38626
changed the title [-]Segementation fault when pyarrow is imported in exit handler[/-][+][Python] Segementation fault when pyarrow is imported in exit handler[/+]on Nov 7, 2023
changed the title [-][Python] Segementation fault when pyarrow is imported in exit handler[/-][+][Python] Segmentation fault when pyarrow is imported in exit handler[/+]on Nov 8, 2023
please, I am having problems, I have tried many time find a solution and failed miserably:
Fatal Python error: Segmentation fault
Current thread 0x00000001053fee00 (most recent call first):
File "", line 488 in _call_with_frames_removed
File "", line 1289 in create_module
File "", line 813 in module_from_spec
File "", line 921 in _load_unlocked
File "", line 1331 in _find_and_load_unlocked
File "", line 1360 in _find_and_load
File "/Users/pong/Library/Python/3.12/lib/python/site-packages/pyarrow/init.py", line 65 in
File "", line 488 in _call_with_frames_removed
File "", line 995 in exec_module
File "", line 935 in _load_unlocked
File "", line 1331 in _find_and_load_unlocked
File "", line 1360 in _find_and_load
File "/Users/pong/Library/Python/3.12/lib/python/site-packages/pandas/compat/pyarrow.py", line 8 in
File "", line 488 in _call_with_frames_removed
File "", line 995 in exec_module
File "", line 935 in _load_unlocked
File "", line 1331 in _find_and_load_unlocked
File "", line 1360 in _find_and_load
File "/Users/pong/Library/Python/3.12/lib/python/site-packages/pandas/compat/init.py", line 27 in
File "", line 488 in _call_with_frames_removed
File "", line 995 in exec_module
File "", line 935 in _load_unlocked
File "", line 1331 in _find_and_load_unlocked
File "", line 1360 in _find_and_load
File "/Users/pong/Library/Python/3.12/lib/python/site-packages/pandas/init.py", line 26 in
File "", line 488 in _call_with_frames_removed
File "", line 995 in exec_module
File "", line 935 in _load_unlocked
File "", line 1331 in _find_and_load_unlocked
File "", line 1360 in _find_and_load
File "/Users/pong/Documents/Study/University/visu/forum_modulo_2.py", line 3 in
Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, PIL._imaging, kiwisolver._cext (total: 4)
@asda10 This does not seem related to this issue, can you open a new issue for it? Also please include a reproducer so that we can try it out ourselves.
Activity
[-]Segementation fault when pyarrow is imported in exit handler[/-][+][Python] Segementation fault when pyarrow is imported in exit handler[/+]kou commentedon Nov 7, 2023
Why do you want to do this...?
gusostow commentedon Nov 8, 2023
Exit handlers in a complex codebase might incidentally import pyarrow especially via pandas.
jorisvandenbossche commentedon Nov 8, 2023
I can confirm the segfault, both with pyarrow 13.0 and main from a few days ago. The gdb bactrace:
jorisvandenbossche commentedon Nov 8, 2023
General cpython issue about issues with threads in finalization: python/cpython#80657 (cc @pitrou)
We do have some protection around acquiring the GIL here, but so that is not sufficient:
arrow/python/pyarrow/src/arrow/python/common.h
Lines 227 to 235 in e62ec62
pitrou commentedon Nov 8, 2023
@jorisvandenbossche Is it the full backtrace? Are there other threads running?
pitrou commentedon Nov 8, 2023
Ok, here is the full backtrace:
[-][Python] Segementation fault when pyarrow is imported in exit handler[/-][+][Python] Segmentation fault when pyarrow is imported in exit handler[/+]GH-38626: [Python] Fix segfault when PyArrow is imported at shutdown (#…
GH-38626: [Python] Fix segfault when PyArrow is imported at shutdown (#…
apacheGH-38626: [Python] Fix segfault when PyArrow is imported at shu…
wilsonborba commentedon Sep 5, 2024
please, I am having problems, I have tried many time find a solution and failed miserably:
pitrou commentedon Sep 5, 2024
@asda10 This does not seem related to this issue, can you open a new issue for it? Also please include a reproducer so that we can try it out ourselves.
pyarrow: replace full-API PyGILState_Check with Py_IsInitialized (abi3)
pyarrow: replace full-API PyGILState_Check with Py_IsInitialized (abi3)
pyarrow: replace full-API PyGILState_Check with Py_IsInitialized (abi3)