简体   繁体   English

在Windows中调试QT 5.8和打开QFileDialog时,gdborig.exe随机崩溃

[英]gdborig.exe crashes randomly when debugging QT 5.8 and opening QFileDialog in windows

I'm using Qt 5.8, with clion as IDE, made with bundled cmake 3.7.2. 我正在使用Qt 5.8,将clion作为IDE,由捆绑的cmake 3.7.2制成。 Using Mingw-w64, x86_64-6.3.0-posix-seh-rt_v5-rev0, which came bundled with GDB 7.11.1. 使用Mingw-w64,x86_64-6.3.0-posix-seh-rt_v5-rev0(与GDB 7.11.1捆绑在一起)。 Using Qt5.8 version from msys2 supposedly compiled with the same version of mingw-64 (couldn't get QT to compile on my system, so that was my only option). 使用msys2的Qt5.8版本应该是用mingw-64的相同版本编译的(无法在我的系统上编译QT,因此这是我唯一的选择)。 This problem seems agnostic to what I'm doing specifically, I'll often have code that works perfectly, no crashes, segfaults or whatever, and when i do the same things in the debugger it hangs for 30 seconds trying to open the QFileDialog , slowly loading the gui as if its going to work, before quickly crashing saying "Gdborig.exe has stopped working". 这个问题似乎与我正在做的事情无关,我经常会得到完美运行的代码,没有崩溃,segfaults之类的东西,当我在调试器中执行相同的操作时,尝试打开QFileDialog会挂起30秒,慢慢加载gui,就像它要工作一样,然后迅速崩溃说“ Gdborig.exe已停止工作”。

Not sure what other context I can provide, as again, only appears after doing the following calls: 不确定是否可以再次提供其他上下文,仅在执行以下调用后出现:

QString fileName = QFileDialog::getSaveFileName(m_parent, QObject::tr("Save File"), QString(), QObject::tr("*");

but it doesn't matter what static method I use, same thing happens on getOpenFileName , and getOpenFileNames . 但是我使用哪种静态方法都没关系,在getOpenFileNamegetOpenFileNamesgetOpenFileName发生同样的事情。 There doesn't seem to be any pattern strictly speaking to the crashing, there are times I can get past it, and there are times I couldn't. 从严格意义上讲,似乎没有任何模式可以用来描述崩溃,有时候我可以克服,有时候我无法。 I originally had a hypothesis that because I was using -pg -Og flags when the issue first appeared that these caused the issue, but I have since removed both of these flags and the issue persists. 我最初有一个假设,因为当问题首次出现时我正在使用-pg -Og标志,这是导致问题的原因,但是此后我删除了这两个标志,问题仍然存在。

I have seen similar behaviour in otherwise perfect applications and I was able to work around this by adding QFileDialog::DontUseNativeDialog as final parameter to the QFileDialog calls. 我曾在其他完善的应用程序中看到过类似的行为,并且可以通过将QFileDialog::DontUseNativeDialog作为最终参数添加到QFileDialog调用来解决此问题。 So I think, this is a COM-apartement issue of the native Windows libraries. 因此,我认为这是Windows本机库的COM公寓问题。 But I have to admit, this is a very wild guess. 但是我不得不承认,这是一个非常疯狂的猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM