Python – Segmentation fault

เวลาเจอ error ว่า Segmentation fault โดยไม่มีคำอธิบายใดๆ จะไปไม่เป็น

เลยจะให้พ่น error ออกมาด้วย Python faulthandler module

First add the following to the top of your module.

import faulthandler; faulthandler.enable()

Then re-run your program with the faulthandler startup flag.

# pass as an argument
python -Xfaulthandler test.py

# Or as an environment variable.
PYTHONFAULTHANDLER=1 python test.py

ก็จะได้ประมาณนี้

$ /usr/local/bin/python3.7  -Xfaulthandler test.py
Fatal Python error: Segmentation fault

Current thread 0x00007fc9540b6740 (most recent call first):
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 261 in items
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 310 in __len__
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/core/series.py", line 599 in __len__
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 962 in _try_convert_data
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 1172 in <lambda>
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 1152 in _process_converter
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 1172 in _try_convert_types
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 892 in parse
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 777 in _get_object_parser
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 755 in read
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/io/json/_json.py", line 618 in read_json
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/util/_decorators.py", line 296 in wrapper
  File "/home/jack/.local/lib/python3.7/site-packages/pandas/util/_decorators.py", line 199 in wrapper
  File "test.py", line 4 in <module>
Segmentation fault