$ ls ~yifei/notes/

如何调试 Python 的 Core Dump

Posted on:

Last modified:

如果需要记录 Core Dump 的原因,首先需要使用 faulthandler 参数启动 Python

python -X faulthandler main.py

出 core 之后,可以使用 gdb 调试

gdb python core

参考

  1. https://stackoverflow.com/questions/2663841/python-tracing-a-segmentation-fault/2664232#2664232
  2. 非常全面的 debug Python 的教程
WeChat Qr Code

© 2016-2022 Yifei Kong. Powered by ynotes

All contents are under the CC-BY-NC-SA license, if not otherwise specified.

Opinions expressed here are solely my own and do not express the views or opinions of my employer.

友情链接: MySQL 教程站