2014-01-10 40 views
4

我剛剛在Mac OS Lion 10.7.5 上通過Macports安裝了python(Python 2.7.6)和pyside(版本1.2.1)。Python/Pyside chrashes沒有錯誤信息

當我想測試這個非常簡單的代碼,蟒蛇崩潰意外:

# -*- coding: utf-8 -*- 
#!/usr/bin/env python 

import sys 
from PySide import QtCore, QtGui 

app = QtGui.QApplication(sys.argv) 
app.exec_() 

# -*- coding: utf-8 -*- 
#!/usr/bin/env python 

import sys 
from PyQt4 import Qt 

app = Qt.QApplication(sys.argv) 
app.exec_() 

工作正常。 (即使它不顯示任何東西,它只是一個裸露的應用程序)

問題是,python只是崩潰,並沒有顯示任何錯誤消息。有誰知道現在該做什麼?

這裏是由Mac OS生成的報告:

Process:   Python [1494] 
Path:   /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 
Identifier:  Python 
Version:   ??? (???) 
Code Type:  X86-64 (Native) 
Parent Process: Python [1450] 

Date/Time:  2014-01-10 16:44:52.411 +0100 
OS Version:  Mac OS X 10.7.5 (11G63) 
Report Version: 9 

Interval Since Last Report:   9814 sec 
Crashes Since Last Report:   29 
Per-App Crashes Since Last Report: 28 
Anonymous UUID:      FA6527AF-EC91-4B5B-B1B3-23AF3ED13089 

Crashed Thread: 0 Dispatch queue: com.apple.main-thread 

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 

VM Regions Near 0: 
--> 
    __TEXT     000000010f1ce000-000000010f1d0000 [ 8K] r-x/rwx SM=COW /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 

Application Specific Information: 
objc[1494]: garbage collection is OFF 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 
0 libsystem_c.dylib    0x00007fff8c5b64f0 strlen + 16 
1 libsystem_c.dylib    0x00007fff8c55234b strdup + 18 
2 libshiboken-python2.7.1.2.dylib 0x00000001133960dd Shiboken::sequenceToArgcArgv(_object*, int*, char***, char const*) + 427 
3 QtGui.so      0x0000000113d37bf7 QApplicationConstructorStart(_object*) + 69 
4 QtGui.so      0x0000000113d38e08 Sbk_QApplication_Init + 384 
5 org.python.python    0x000000010f2306d4 type_call + 372 
6 org.python.python    0x000000010f1df521 PyObject_Call + 97 
7 org.python.python    0x000000010f270dda PyEval_EvalFrameEx + 10618 
8 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
9 org.python.python    0x000000010f26dc46 PyEval_EvalCode + 54 
10 org.python.python    0x000000010f294d9e PyRun_FileExFlags + 174 
11 org.python.python    0x000000010f26a2ca builtin_execfile + 490 
12 org.python.python    0x000000010f270b17 PyEval_EvalFrameEx + 9911 
13 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
14 org.python.python    0x000000010f275a0d fast_function + 285 
15 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
16 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
17 org.python.python    0x000000010f2700e6 PyEval_EvalFrameEx + 7302 
18 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
19 org.python.python    0x000000010f275a0d fast_function + 285 
20 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
21 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
22 org.python.python    0x000000010f275a0d fast_function + 285 
23 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
24 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
25 org.python.python    0x000000010f275a0d fast_function + 285 
26 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
27 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
28 org.python.python    0x000000010f275a0d fast_function + 285 
29 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
30 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
31 org.python.python    0x000000010f275a0d fast_function + 285 
32 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
33 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
34 org.python.python    0x000000010f20307b function_call + 347 
35 org.python.python    0x000000010f1df521 PyObject_Call + 97 
36 org.python.python    0x000000010f272f76 PyEval_EvalFrameEx + 19222 
37 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
38 org.python.python    0x000000010f20307b function_call + 347 
39 org.python.python    0x000000010f1df521 PyObject_Call + 97 
40 org.python.python    0x000000010f272f76 PyEval_EvalFrameEx + 19222 
41 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
42 org.python.python    0x000000010f275a0d fast_function + 285 
43 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
44 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
45 org.python.python    0x000000010f275a0d fast_function + 285 
46 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
47 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
48 org.python.python    0x000000010f20307b function_call + 347 
49 org.python.python    0x000000010f1df521 PyObject_Call + 97 
50 org.python.python    0x000000010f272f76 PyEval_EvalFrameEx + 19222 
51 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
52 org.python.python    0x000000010f275a0d fast_function + 285 
53 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
54 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
55 org.python.python    0x000000010f275a0d fast_function + 285 
56 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
57 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
58 org.python.python    0x000000010f275a0d fast_function + 285 
59 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
60 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
61 org.python.python    0x000000010f275a0d fast_function + 285 
62 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
63 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
64 org.python.python    0x000000010f26dc46 PyEval_EvalCode + 54 
65 org.python.python    0x000000010f294d9e PyRun_FileExFlags + 174 
66 org.python.python    0x000000010f294900 PyRun_SimpleFileExFlags + 768 
67 org.python.python    0x000000010f2a87a8 Py_Main + 2952 
68 org.python.python    0x000000010f1cff24 0x10f1ce000 + 7972 

Thread 1: 
0 libsystem_kernel.dylib   0x00007fff8f637d7a __recvfrom + 10 
1 _socket.so      0x000000011063e39c sock_recv_guts + 460 
2 _socket.so      0x000000011063cfc1 sock_recv + 129 
3 org.python.python    0x000000010f272f5f PyEval_EvalFrameEx + 19199 
4 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
5 org.python.python    0x000000010f275a0d fast_function + 285 
6 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
7 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
8 org.python.python    0x000000010f275a0d fast_function + 285 
9 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
10 org.python.python    0x000000010f2759a2 fast_function + 178 
11 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
12 org.python.python    0x000000010f2759a2 fast_function + 178 
13 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
14 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
15 org.python.python    0x000000010f20307b function_call + 347 
16 org.python.python    0x000000010f1df521 PyObject_Call + 97 
17 org.python.python    0x000000010f1eb196 instancemethod_call + 502 
18 org.python.python    0x000000010f1df521 PyObject_Call + 97 
19 org.python.python    0x000000010f2751b8 PyEval_CallObjectWithKeywords + 168 
20 org.python.python    0x000000010f2aab46 t_bootstrap + 70 
21 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
22 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 2: 
0 libsystem_kernel.dylib   0x00007fff8f6387e6 kevent + 10 
1 libzmq.3.dylib     0x0000000110f075c9 zmq::kqueue_t::loop() + 165 
2 libzmq.3.dylib     0x0000000110f198ce thread_routine + 106 
3 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
4 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 3: 
0 libsystem_kernel.dylib   0x00007fff8f6387e6 kevent + 10 
1 libzmq.3.dylib     0x0000000110f075c9 zmq::kqueue_t::loop() + 165 
2 libzmq.3.dylib     0x0000000110f198ce thread_routine + 106 
3 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
4 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 4: 
0 libsystem_kernel.dylib   0x00007fff8f638a7a poll + 10 
1 libzmq.3.dylib     0x0000000110f1fa47 zmq_poll + 460 
2 libzmq.3.dylib     0x0000000110f0eb4c zmq::proxy(zmq::socket_base_t*, zmq::socket_base_t*, zmq::socket_base_t*) + 138 
3 _device.so      0x0000000110fb02be __pyx_pw_3zmq_7backend_6cython_7_device_3proxy + 926 
4 org.python.python    0x000000010f1df521 PyObject_Call + 97 
5 _device.so      0x0000000110fb144a __pyx_pw_3zmq_7backend_6cython_7_device_1device + 1130 
6 org.python.python    0x000000010f270b17 PyEval_EvalFrameEx + 9911 
7 org.python.python    0x000000010f2759a2 fast_function + 178 
8 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
9 org.python.python    0x000000010f2759a2 fast_function + 178 
10 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
11 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
12 org.python.python    0x000000010f20307b function_call + 347 
13 org.python.python    0x000000010f1df521 PyObject_Call + 97 
14 org.python.python    0x000000010f1eb196 instancemethod_call + 502 
15 org.python.python    0x000000010f1df521 PyObject_Call + 97 
16 org.python.python    0x000000010f2751b8 PyEval_CallObjectWithKeywords + 168 
17 org.python.python    0x000000010f2aab46 t_bootstrap + 70 
18 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
19 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 5: 
0 libsystem_kernel.dylib   0x00007fff8f6387e6 kevent + 10 
1 libzmq.3.dylib     0x0000000110f075c9 zmq::kqueue_t::loop() + 165 
2 libzmq.3.dylib     0x0000000110f198ce thread_routine + 106 
3 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
4 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 6: 
0 libsystem_kernel.dylib   0x00007fff8f6387e6 kevent + 10 
1 libzmq.3.dylib     0x0000000110f075c9 zmq::kqueue_t::loop() + 165 
2 libzmq.3.dylib     0x0000000110f198ce thread_routine + 106 
3 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
4 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 7: 
0 libsystem_kernel.dylib   0x00007fff8f637bca __psynch_cvwait + 10 
1 libsystem_c.dylib    0x00007fff8c566274 _pthread_cond_wait + 840 
2 org.python.python    0x000000010f2a6541 PyThread_acquire_lock + 97 
3 org.python.python    0x000000010f26d97d PyEval_RestoreThread + 61 
4 _sqlite3.so      0x0000000110cebd39 pysqlite_step + 41 
5 _sqlite3.so      0x0000000110ce6fa8 pysqlite_connection_commit + 232 
6 org.python.python    0x000000010f1df521 PyObject_Call + 97 
7 org.python.python    0x000000010f1df6ff call_function_tail + 95 
8 org.python.python    0x000000010f1df96e PyObject_CallMethod + 318 
9 _sqlite3.so      0x0000000110ce862c pysqlite_connection_exit + 124 
10 org.python.python    0x000000010f1df521 PyObject_Call + 97 
11 org.python.python    0x000000010f1da37e PyObject_CallFunctionObjArgs + 382 
12 org.python.python    0x000000010f27269e PyEval_EvalFrameEx + 16958 
13 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
14 org.python.python    0x000000010f275a0d fast_function + 285 
15 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
16 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
17 org.python.python    0x000000010f20307b function_call + 347 
18 org.python.python    0x000000010f1df521 PyObject_Call + 97 
19 org.python.python    0x000000010f272f76 PyEval_EvalFrameEx + 19222 
20 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
21 org.python.python    0x000000010f275a0d fast_function + 285 
22 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
23 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
24 org.python.python    0x000000010f275a0d fast_function + 285 
25 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
26 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
27 org.python.python    0x000000010f20307b function_call + 347 
28 org.python.python    0x000000010f1df521 PyObject_Call + 97 
29 org.python.python    0x000000010f272f76 PyEval_EvalFrameEx + 19222 
30 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
31 org.python.python    0x000000010f275a0d fast_function + 285 
32 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
33 org.python.python    0x000000010f2759a2 fast_function + 178 
34 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
35 org.python.python    0x000000010f2759a2 fast_function + 178 
36 org.python.python    0x000000010f270bb8 PyEval_EvalFrameEx + 10072 
37 org.python.python    0x000000010f26e416 PyEval_EvalCodeEx + 1990 
38 org.python.python    0x000000010f20307b function_call + 347 
39 org.python.python    0x000000010f1df521 PyObject_Call + 97 
40 org.python.python    0x000000010f1eb196 instancemethod_call + 502 
41 org.python.python    0x000000010f1df521 PyObject_Call + 97 
42 org.python.python    0x000000010f2751b8 PyEval_CallObjectWithKeywords + 168 
43 org.python.python    0x000000010f2aab46 t_bootstrap + 70 
44 libsystem_c.dylib    0x00007fff8c5628bf _pthread_start + 335 
45 libsystem_c.dylib    0x00007fff8c565b75 thread_start + 13 

Thread 8:: Dispatch queue: com.apple.libdispatch-manager 
0 libsystem_kernel.dylib   0x00007fff8f6387e6 kevent + 10 
1 libdispatch.dylib    0x00007fff9172e786 _dispatch_mgr_invoke + 923 
2 libdispatch.dylib    0x00007fff9172d316 _dispatch_mgr_thread + 54 

回答

1

該示例應用在QT Wiki略有不同。在你的系統上嘗試一下確切的腳本。嘗試通過

蟒蛇script.py

它看起來像崩潰是從解析sys.argv中引起運行腳本。檢查導致崩潰的系統日誌。嘗試系統上的其他QT應用程序以查看是否存在錯誤。