更新时间:2021-09-30 19:33:36
当 python extension(用 C 编写)试图访问无法访问的内存时会发生这种情况.
This happens when a python extension (written in C) tries to access a memory beyond reach.
您可以通过以下方式对其进行跟踪.
You can trace it in following ways.
sys.settrace
在代码的第一行.使用 Mark 在 this answergdb/a>.. 在命令提示符下
sys.settrace
at the very first line of the code.Use gdb
as described by Mark in this answer.. At the command prompt
gdb python
(gdb) run /path/to/script.py
## wait for segfault ##
(gdb) backtrace
## stack trace of the c code