5

I am desperately looking for a cause of crashes in my Qt-based Application.

After some observation I've detected, that alone opening a QFileDialog, which is standard windows file dialog, even without selecting any file, causes the application to crash after some minutes. It doesn't happen on all machines.

I've opened my application in dependency walker and the profiling revealed, that opening of file dialog loads tons of DLLs, which I don't need in my application - all the tools which hooked in windows shell. Among the others - TortoiseSVN, which even makes depends to freeze.

Is it possible in an application context to prevent other DLLs like codecs or shell-hooks to be loaded?

Is it at least possible to create a QFileDialog without loading all the tool hooked in windows?

enter image description here

Valentin H
  • 7,240
  • 12
  • 61
  • 111
  • TortoiseSVN appears to be a well maintained project. If you can demonstrate that it is causing your application to crash - and that it is TortoiseSVN's fault rather than yours - I would expect a reasonably prompt resolution of the problem. – Harry Johnston Apr 10 '15 at 00:27
  • I'm afraid, I don't have the skills for tracing this problem on Windows. What I have observed is the following: The application, which allocates and de-allocates huge amount of data on heap, creates/deletes many threads dynamically (pattern analysis in images) doesn't crash, when I never open a file-open dialog (provide all paths and by a command line). In contrast, the application reproducibly crashes without doing anything only by opening and canceling a file dialog. It's not SVN only. Maybe the combination of all shell hooked tools. Tortoise SVN only stopped depends from profiling. – Valentin H Apr 10 '15 at 08:08

1 Answers1

3

This is definitely possible, but it's not trivial. What you have to do is insert an API hook on LoadLibrary (and/or the Native API equivalent.) When your hook is called, you can examine the DLL filename and decide whether you want to pass it along to the real LoadLibrary or return an error.

A couple places to find more info on API hooks:

Now all of that said, for your specific situation you may be better off just changing your TortoiseSVN settings. If you set the include/exclude paths in Tortoise to only look at directories on your computer that contain SVN repos, I bet this freeze will go away as long as you avoid those directories.

MrEricSir
  • 8,044
  • 4
  • 30
  • 35
  • Very interesting, Thanks! I will try both. However, only reconfiguring SVN on my machine won't solve the problem. I can't know, which add-ons the customer could install on her computers. Of cause, I can neither know, which DLLs to prevent from loading. At least logging all loaded DLLs could help to find the potential crashes on customer's machines. – Valentin H Apr 09 '15 at 23:00