2012-08-23 59 views
3

我試圖調試一個segfault,我在一個多線程的qt webkit應用程序中獲取。我安裝了Python-DBG爲了讓我在gdb漂亮印花的目的,並獲得啓動python-dbg在調試時找不到Py_InitModule4

python2.7-dbg node.py 
Traceback (most recent call last): 
    File "node.py", line 4, in <module> 
    import msgpack 
    File "/usr/lib/pymodules/python2.7/msgpack/__init__.py", line 3, in <module> 
    from msgpack._msgpack import * 
ImportError: /usr/lib/pymodules/python2.7/msgpack/_msgpack.so: undefined symbol: Py_InitModule4 
Error in sys.excepthook: 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook 
    from apport.fileutils import likely_packaged, get_recent_crashes 
    File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module> 
    from apport.report import Report 
    File "/usr/lib/python2.7/dist-packages/apport/report.py", line 20, in <module> 
    import apport.fileutils 
    File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 22, in <module> 
    from apport.packaging_impl import impl as packaging 
    File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module> 
    import apt 
    File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 21, in <module> 
    import apt_pkg 
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: Py_InitModule4 

Original exception was: 
Traceback (most recent call last): 
    File "node.py", line 4, in <module> 
    import msgpack 
    File "/usr/lib/pymodules/python2.7/msgpack/__init__.py", line 3, in <module> 
    from msgpack._msgpack import * 
ImportError: /usr/lib/pymodules/python2.7/msgpack/_msgpack.so: undefined symbol: Py_InitModule4 

我得到同樣的事情,當我運行一個版本不msgpack使用腳本以下錯誤.. 。

Traceback (most recent call last): 
    File "scraper.py", line 2, in <module> 
    from planeswalker import PlaneswalkerParser 
    File "/var/www/rails_projects/MCPro.com/lib/planeswalker/planeswalker.py", line 2, in <module> 
    from PyQt4.QtCore import * 
ImportError: /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so: undefined symbol: Py_InitModule4 
Error in sys.excepthook: 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook 
    from apport.fileutils import likely_packaged, get_recent_crashes 
    File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module> 
    from apport.report import Report 
    File "/usr/lib/python2.7/dist-packages/apport/report.py", line 20, in <module> 
    import apport.fileutils 
    File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 22, in <module> 
    from apport.packaging_impl import impl as packaging 
    File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module> 
    import apt 
    File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 21, in <module> 
    import apt_pkg 
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: Py_InitModule4 

Original exception was: 
Traceback (most recent call last): 
    File "scraper.py", line 2, in <module> 
    from planeswalker import PlaneswalkerParser 
    File "/var/www/rails_projects/MCPro.com/lib/planeswalker/planeswalker.py", line 2, in <module> 
    from PyQt4.QtCore import * 
ImportError: /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so: undefined symbol: Py_InitModule4 

在這兩種情況下它看起來Py_InitModule4 ...任何想法的Python專家?代碼運行良好(除了segfault以後)與普通python 2.7

如果有一個更容易的方式來在gdb中獲得漂亮的打印我也打開。基本上只是尋找一個python風格stacktrace

回答

2

在戳一下後,它看起來像在過去的Ubuntu的python-dbg庫中有與此有關的錯誤。我提出了一個錯誤,發現我沒有閱讀文檔。它需要安裝庫的-dbg版本(MySQLdb的和PyQt4的在這種情況下)

沒有版本信息包所以我張貼在如何做到這一點

這裏是另外一個問題錯誤報告標記爲無效的參考https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1040914