Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.8.5, 5.1.0
-
None
-
Windows, MinGW.
Description
Under Windows, when loading a plugin DLL that was compiled with the Embedded Profiler DLL (http://embeddedprofiler.com/), the application aborts with SIGSEGV.
The crash happens because QLibrary::isPlugin() (or QLibrary::updatePluginState() in Qt 5) tries to get plugin verification data by calling qt_plugin_query_verification_data() function in plugin DLL. But it is instrumented, so compiler inserts a call to __cyg_profile_func_enter. It resides in EProfiler.dll, which is not loaded because the plugin is loaded with DONT_RESOLVE_DLL_REFERENCES flag. And so the application crashes.
The Old New Thing blog (http://blogs.msdn.com/b/oldnewthing/archive/2005/02/14/372266.aspx) suggests to avoid DONT_RESOLVE_DLL_REFERENCES flag. It recommends to use resources if you want to just get some data from DLL. LOAD_LIBRARY_AS_DATAFILE flag seems to be the right way to do it.
The MSDN also agrees with that (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179.aspx).