Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32249

Unable to load plugin DLLs compiled with the Embedded Profiler DLL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.5, 5.1.0
    • Core: Plugins
    • 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).

      Attachments

        1. eproftest.zip
          104 kB
          Alexandr Zarubkin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            azarubkin Alexandr Zarubkin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes