Python / Pyside崩溃,没有错误消息

时间:2014-01-10 15:44:18

标签: python macos osx-lion pyside

我刚刚在Mac OS Lion 10.7.5上安装了带有pyside(版本1.2.1)的python(Python 2.7.6)  通过Macports。

当我想测试这个非常简单的代码时,python意外崩溃:

# -*- 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 个答案:

答案 0 :(得分:2)

QT Wiki的示例应用略有不同。在您的系统上尝试那个确切的脚本。尝试通过

运行脚本
  

python script.py

看起来崩溃是由解析sys.argv引起的。检查导致崩溃的系统日志。在您的系统上尝试其他QT应用程序,看看是否有错误。