python已停止工作 pyqt,Python 3.4:Windows上的PyQt:仅在某些计算机上退出时崩溃

I have a Python program that I packaged with cx_freeze to make executable. The program is strictly a desktop program for data acquisition. It works fine and exits fine on every computer, but on one desktop of one of our collaborators with Windows 7 on it, it crashes only on exit (I emphasize that no pythonic errors are given. Just a low-level crash with zero information about it). Simply starting and exiting the program crashes it!

I got the guy to create a memory dump for me, and he did. The weird part is the following: Creating a memory dump out of this and analyzing it with WinDbg gives the following chain of errors:

STACK_TEXT:

WARNING: Stack unwind information not available. Following frames may be wrong.

0020f940 5c51b34e 5c7bd640 9d7a3385 03c93748 QtCore4!QHashData::free_helper+0x26

0020f974 76e314bd 00b30000 00000000 03e0c4c0 QtGui4!QGestureRecognizer::reset+0x1f9e

0020f9a0 5c51c968 03c93748 5d3608c2 00000001 kernel32!HeapFree+0x14

0020f9a8 5d3608c2 00000001 03c93748 03891250 QtGui4!QGestureRecognizer::reset+0x35b8

0020f9c0 5d3627b5 9d0dae1c 03891250 03cac0a0 QtCore4!QObjectPrivate::deleteChildren+0x72

00000000 00000000 00000000 00000000 00000000 QtCore4!QObject::~QObject+0x3e5

Now what surprises me is that a complaint from QGestureRecognizer (which is a part of QtGUI apparently) is given! But why? I don't use any touch capabilities! The modules I use are: QtCore and QtGUI. Where is this coming from? Can I, like, force disable everything related to that class: QGestureRecognizer? What would you do in this case?

Update:

This issue seems to happen ONLY on Windows 7 computers. It was tested on 2 computers with Windows 7 and the same crash happened.

解决方案

It turned out that ALL the problems I used to have with this program crashing were because of QThread (on Windows). All the users I know of that used QThread on Windows got similar issues, and for some reason no one is fixing it.

Avoid QThread on Python. It's completely useless and more harmful than useful. I went now to multiprocessing. It's much better and isn't affected by GIL.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值