問題描述
我正在嘗試執行 Python 腳本,但出現以下錯誤:
I'm trying to execute a Python script, but I am getting the following error:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
我在 Linux Mint 18.1 Serena 操作系統上使用 python 3.5.2
I'm using python 3.5.2 on a Linux Mint 18.1 Serena OS
誰能告訴我為什么會這樣,我該如何解決?
Can someone tell me why this happens, and how can I solve?
推薦答案
SIGSEGV 信號指示分段違規"或段錯誤".或多或少,這相當于讀取或寫入未在進程中映射的內存地址.
The SIGSEGV signal indicates a "segmentation violation" or a "segfault". More or less, this equates to a read or write of a memory address that's not mapped in the process.
這表明您的程序中存在錯誤.在 Python 程序中,這要么是解釋器中的錯誤,要么是正在使用的擴展模塊中的錯誤(后者是最常見的原因).
This indicates a bug in your program. In a Python program, this is either a bug in the interpreter or in an extension module being used (and the latter is the most common cause).
要解決此問題,您有多種選擇.一種選擇是生成一個最小的、獨立的、完整的示例來復制問題,然后將其作為錯誤報告提交給它使用的擴展模塊的維護者.
To fix the problem, you have several options. One option is to produce a minimal, self-contained, complete example which replicates the problem and then submit it as a bug report to the maintainers of the extension module it uses.
另一種選擇是嘗試自己找出原因.gdb 是一個有價值的工具,Python 的調試版本和所有正在使用的擴展模塊.
Another option is to try to track down the cause yourself. gdb is a valuable tool in such an endeavor, as is a debug build of Python and all of the extension modules in use.
安裝 gdb 后,您可以使用它來運行您的 Python 程序:
After you have gdb installed, you can use it to run your Python program:
gdb --args python <more args if you want>
然后使用 gdb 命令來追蹤問題.如果您使用 run
,那么您的程序將一直運行到崩潰為止,您將有機會使用其他 gdb 命令檢查狀態.
And then use gdb commands to track down the problem. If you use run
then your program will run until it would have crashed and you will have a chance to inspect the state using other gdb commands.
這篇關于進程以退出代碼 139 結束(被信號 11 中斷:SIGSEGV)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!