Qt creator ошибка при запуске приложения 0xc0000005

This topic has been deleted. Only users with topic management privileges can see it.

  • Hello everybody,
    I’m having a hard time installing Qt Creator on windows 7 x64

    I’ve tried the offline installer, online installer:
    qt-creator-opensource-windows-x86_64-6.0.0.exe
    qt-unified-windows-x86-4.2.0-online.exe

    Both give me an immediate error:
    «The application was unable to start correctly (0xc0000005).
    Click OK to close the application»

    Any ideas what might be the issue?

    TIA!

  • @Mojofarmer QtCreator 6 is based on Qt6 which does not support Windows 7 anymore.
    You will have to stay with QtCreator 5.
    Or, better, upgrade to a more recent Windows version, as Windows 7 reached end of life quite some time ago already.

  • Thanks a lot jslum!

    I’ll give Qt5 a try first, not too excited about having to upgrade my OS right now….

    Downloading qt-everywhere-src-5.15.2.zip from:
    https://download.qt.io/archive/qt/5.15/5.15.2/ should get me up and running just like qt-creator-opensource-windows-x86_64-6.0.0.exe would have, right?

  • @Mojofarmer Use the Qt online installer to install Qt and QtCreator offline installer from https://download.qt.io/official_releases/qtcreator/5.0/5.0.3/ to install QtCreator 5.

  • @jsulm Thanks a lot for your help jslum!

  • FWIW I’ve made a relevant FR asking for Win7 support in the online installer (essentially, asking to add QtCreator 5 back to the available component repos) at https://bugreports.qt.io/browse/QTBUG-100421.

    Also, if anybody’s looking, a full directory of older Creator versions can be found at https://download.qt.io/official_releases/qtcreator/ (there doesn’t seem to be a direct link to past versions on the main website).

    I had success with @jsulm’s suggestion; using the latest online installer (you can install the Qt5 toolchains with it still) and then separately installing Qt Creator 5 alongside it (in a different directory). It does leave the non-working Qt Creator 6 installed but it mostly doesn’t hurt anything, just takes up some extra drive space.

  • Thank you. I also got it working.

  • This is very interesting crash and I think it should be considered as Qt bug. This problem arise only under very special circumstances. But one after another.

    You will identify this problem when your application stopped/exited immediately after the start without any visible error message. It looks like the application isn’t executed at all. When you check application log (Computer -> manage -> Event viewer -> Windows logs -> Application), you will see Error logs:

    Windows applications logs

    The most interesting part of this log is crash location: ntdll.dll

    Faulting application name: Skipper.exe, version: 3.0.1.1120, time stamp: 0x53e9c8d7
    Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp: 0x521ea8e7
    Exception code: 0xc0000005
    Fault offset: 0x0002e3be
    Faulting process id: 0x1c88
    Faulting application start time: 0x01cfb606553e594b
    Faulting application path: T:S2Skipper.exe
    Faulting module path: C:WindowsSysWOW64ntdll.dll
    Report Id: 98cc8228-21f9-11e4-ab5d-005056c00008
    

    At first sight it seems like some problem inside the windows. But the opposite is true, the problem (as almost always) is inside your app ;-).

    As the next step, you can try to debug this executable via Visual Studio to see what happens inside. Simply open executable as project together with .pdb files and execute it. Now you can see that application is correctly executed but crashes as soon as it touches Qt library. The location of crash is inside ntdll.dll in RtlHeapFree() function.

    Debuging crash in VisualStudio 2013

    So the problem is inside the Qt, right? Almost true, but not for the 100%. When I tried to run this application on computers of my colleagues, everything works ok. So why the application doesn’t work on my computer too?

    Resolution

    The problem is in new Qt5 plugin system. Besides the common Qt5*.dll files which are loaded immediately after the application start, Qt5 is also loading plugins/platform-plugins dynamically when the application is executed. To locate this plugins, Qt5 uses following method to identify directories where to search for plugins:

    QStringList QCoreApplication::libraryPaths()
    

    For some strange reason this library returns as first directory path where Qt5 libraries were compiled and after that location based on the executable. So if your Qt5 path is C:Qt5, this will be the first path where all plugins are searched for, no matter if the correct version of plugin is located in APPplugins or APPplatforms. I think this is serious bug in Qt5.

    Where is the problem?

    And here we’re getting to the core of the whole problem.

    If application is compiled on computer with one compiler and used on second  computer which contains the same path to which original computer has installed Qt, the application will load all plugins from your folder instead of itself folder.

    In case your computer will contain different version of Qt, different compiler or different platform, application loads incorrect libraries and crashes. Completely, silently and without easy way to determine what’s wrong.

    Solution?

    The solution is simple, but it isn’t achievable from outside of the Qt library. It would be necessary to Qt as first tried to load libraries from application directory. And only if no plugins were found in application directory, the application would try to search for plugins in Qt directory.

    Qt change solution

    The simplest way how to fix this issue inside the Qt library would be to rename/update appendApplicationPathToLibraryPaths  function to prependApplicationPathToLibraryPaths and change

    void QCoreApplicationPrivate::prependApplicationPathToLibraryPaths()
    {
    #ifndef QT_NO_LIBRARY
        QStringList *app_libpaths = coreappdata()->app_libpaths;
        if (!app_libpaths)
            coreappdata()->app_libpaths = app_libpaths = new QStringList;
        QString app_location = QCoreApplication::applicationFilePath();
        app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
    #ifdef Q_OS_WINRT
        if (app_location.isEmpty())
            app_location.append(QLatin1Char('/'));
    #endif
        app_location = QDir(app_location).canonicalPath();
        if (QFile::exists(app_location) && !app_libpaths->contains(app_location))
            //CHANGE THIS ROW: app_libpaths->append(app_location);
            //TO FOLLOWING
            app_libpaths->prepend(app_location);
    #endif
    }
    

    InApp solution

    Unfortunately it isn’t possible to simply change this behavior from your app. All of these operations happen directly in QCoreApplication constructor so if you try to change it after, it’s too late.

    The temporary solution before this problem will be resolved is to reinitialize library paths before QCoreApplication is initialized. It’s necessary to clean libray paths, compute new paths and re-initialize QCoreApplication::libraryPaths before QCoreApplication object is initialized. This can be done in main.cpp of your application before you will create QApplication/QCoreApplication object.

      QString executable = argv[0];
      QString executablePath = executable.mid(0,executable.lastIndexOf("\"));
      QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
      QCoreApplication::removeLibraryPath(installPathPlugins);
      QCoreApplication::addLibraryPath(installPathPlugins);
      QCoreApplication::addLibraryPath(executablePath);
    

    It’s not a nice solution, but it works. I tried  to report this issue also to bugreports.QtProject, so maybe in later version this will be fixed.

    При нажатии на qtcreator.exe получаю ошибку 0xc0000005 и собственно запустить среду нереально , пробовал отключать антивирус, запускать от имени администратора, проверял на наличие злокачественных обновлений . Проверял ЖД на наличие драйверов и пк на общую целосность драйверов , но к сожалению это ничего не дало (И да я перезагружал пк).

    • c++
    • windows
    • qtcreator
    • windows-7

    задан 3 дек 2021 в 17:50

    MarshalStroheim's user avatar

    1

    • Либо не указан путь к библиотекам приложения, либо надо заново переустановить

      4 дек 2021 в 5:22

    1 ответ

    0xdb's user avatar

    0xdb

    51.5k198 золотых знаков59 серебряных знаков237 бронзовых знаков

    ответ дан 17 дек 2021 в 23:51

    Сергей Устинов's user avatar

    This is very interesting crash and I think it should be considered as Qt bug. This problem arise only under very special circumstances. But one after another.

    You will identify this problem when your application stopped/exited immediately after the start without any visible error message. It looks like the application isn’t executed at all. When you check application log (Computer -> manage -> Event viewer -> Windows logs -> Application), you will see Error logs:

    Windows applications logs

    The most interesting part of this log is crash location: ntdll.dll

    Faulting application name: Skipper.exe, version: 3.0.1.1120, time stamp: 0x53e9c8d7
    Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp: 0x521ea8e7
    Exception code: 0xc0000005
    Fault offset: 0x0002e3be
    Faulting process id: 0x1c88
    Faulting application start time: 0x01cfb606553e594b
    Faulting application path: T:\S2\Skipper.exe
    Faulting module path: C:\Windows\SysWOW64\ntdll.dll
    Report Id: 98cc8228-21f9-11e4-ab5d-005056c00008
    

    At first sight it seems like some problem inside the windows. But the opposite is true, the problem (as almost always) is inside your app ;-).

    As the next step, you can try to debug this executable via Visual Studio to see what happens inside. Simply open executable as project together with .pdb files and execute it. Now you can see that application is correctly executed but crashes as soon as it touches Qt library. The location of crash is inside ntdll.dll in RtlHeapFree() function.

    Debuging crash in VisualStudio 2013

    So the problem is inside the Qt, right? Almost true, but not for the 100%. When I tried to run this application on computers of my colleagues, everything works ok. So why the application doesn’t work on my computer too?

    Resolution

    The problem is in new Qt5 plugin system. Besides the common Qt5*.dll files which are loaded immediately after the application start, Qt5 is also loading plugins/platform-plugins dynamically when the application is executed. To locate this plugins, Qt5 uses following method to identify directories where to search for plugins:

    QStringList QCoreApplication::libraryPaths()
    

    For some strange reason this library returns as first directory path where Qt5 libraries were compiled and after that location based on the executable. So if your Qt5 path is C:\Qt5, this will be the first path where all plugins are searched for, no matter if the correct version of plugin is located in APP\plugins or APP\platforms. I think this is serious bug in Qt5.

    Where is the problem?

    And here we’re getting to the core of the whole problem.

    If application is compiled on computer with one compiler and used on second  computer which contains the same path to which original computer has installed Qt, the application will load all plugins from your folder instead of itself folder.

    In case your computer will contain different version of Qt, different compiler or different platform, application loads incorrect libraries and crashes. Completely, silently and without easy way to determine what’s wrong.

    Solution?

    The solution is simple, but it isn’t achievable from outside of the Qt library. It would be necessary to Qt as first tried to load libraries from application directory. And only if no plugins were found in application directory, the application would try to search for plugins in Qt directory.

    Qt change solution

    The simplest way how to fix this issue inside the Qt library would be to rename/update appendApplicationPathToLibraryPaths  function to prependApplicationPathToLibraryPaths and change

    void QCoreApplicationPrivate::prependApplicationPathToLibraryPaths()
    {
    #ifndef QT_NO_LIBRARY
        QStringList *app_libpaths = coreappdata()->app_libpaths;
        if (!app_libpaths)
            coreappdata()->app_libpaths = app_libpaths = new QStringList;
        QString app_location = QCoreApplication::applicationFilePath();
        app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
    #ifdef Q_OS_WINRT
        if (app_location.isEmpty())
            app_location.append(QLatin1Char('/'));
    #endif
        app_location = QDir(app_location).canonicalPath();
        if (QFile::exists(app_location) && !app_libpaths->contains(app_location))
            //CHANGE THIS ROW: app_libpaths->append(app_location);
            //TO FOLLOWING
            app_libpaths->prepend(app_location);
    #endif
    }
    

    InApp solution

    Unfortunately it isn’t possible to simply change this behavior from your app. All of these operations happen directly in QCoreApplication constructor so if you try to change it after, it’s too late.

    The temporary solution before this problem will be resolved is to reinitialize library paths before QCoreApplication is initialized. It’s necessary to clean libray paths, compute new paths and re-initialize QCoreApplication::libraryPaths before QCoreApplication object is initialized. This can be done in main.cpp of your application before you will create QApplication/QCoreApplication object.

      QString executable = argv[0];
      QString executablePath = executable.mid(0,executable.lastIndexOf("\\"));
      QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
      QCoreApplication::removeLibraryPath(installPathPlugins);
      QCoreApplication::addLibraryPath(installPathPlugins);
      QCoreApplication::addLibraryPath(executablePath);
    

    It’s not a nice solution, but it works. I tried  to report this issue also to bugreports.QtProject, so maybe in later version this will be fixed.


    This topic has been deleted. Only users with topic management privileges can see it.

  • Hello,

    I am working on a GUI multi platform application with qt4.7.4, the structure of my application is decomposed as below:

    — mainapp (app)
    — model ==> (LIB)
    — view ==> (LIB)
    — controller==> (LIB)
    — qwt ==> (LIB)

    The program work and run normally on linux , but now i am trying to port it on Windows 7 (on windows i am using qt4.7.4 too with mingw),

    **when i try to build it on windows , there is no problem **, but when i try to run it i have the following message

    The program has unexpectedly finished.

    and when i try to debug it i have the following error

    During startup program exited with code 0xc0000005

    i don’t know why i am having that problem only in windows ?

    Do have any idea , is that related to qwt dll or any other dll ,do i have to add the dll to path system on windows ?

    Any suggestion for solving this problem is welcome !

  • if you use extra DLLs, try put them in build folder for test.
    If you run it from creator and uses no extra dlls its something else.

  • Hello mrjj,
    Thank’s for your reply,

    Actually i am running the application from qt creator, and the only extra dll that i use is qwt , i tried to put qwt.dll on the build folder but i still have the same problem, do you have any other suggestion?

    There is one intersting thing that i noticed , it’s that when i tried to build an old version of the project before using qwt and i can run it without any problem , i suppose then that the problem is from the dll of qwt but i don’t now how to detect it?

    Regards!

  • @mostefa
    ok. So it does sound like the dll.
    you could try with http://www.dependencywalker.com/
    and see if it list qwt as missing.
    (Run tool on your .exe in build folder)
    In that case put DLL somewhere in PATH
    and see if that helps.

    This dll , did you compile it your self?
    If possible , you could get qwt and compile a new DLL.
    Sometimes name mangling can give issues if program and DLL uses different compilers.

  • @mrjj

    Thank’s for your fast reply, indeed i am compiling my dll myself inside my project with the same compiler used for the whole project,

    But,when i use dependencywalker i can see (error opening file, invalid path) for the following dll:

    IEHIMS.DLL
    GPSVC.DLL
    DCOMP.DLL
    API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL
    API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
    API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
    API-MS-WIN-CORE-WINRT-L1-1-0.DLL
    API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
    API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL

    and i am thinking that the problem is related to x64 arch for my windows 7
    you can look here:

    http://stackoverflow.com/questions/17023419/win-7-64-bit-dll-problems

    but for the moment i don’t know how to solve it !

    don’t you have any idea?

  • @mostefa
    Hmm. I think you are right.
    Seems to be related to Visual studio «redistributable package.»
    But seems it can both be caused by having it installed and also not having it installed.
    You could try to install the correct version for your compiler.
    Should be part of VS install but some say its not.
    Did you try all in that thread?

  • @mrjj

    For the moment i didn’t try all what the thread suggest, because i don’t understand one thing ,

    If the problem is really from visual , so why any other application work fine without any problem? :s

  • @mostefa
    Yeah that is the odd part indeed. If it was from missing DLLs or something like that, it should also affect
    other apps.

    You could try to make program run from build folder and see that way if just sort of like
    Creator that wont work/start app with dll.

    You need to copy dlls ( d versions if debug build) from c:\qt\vs20XX folder to build folder.
    Also make a sub folder called platforms and copy from c:\qt\VS20xx\platforms folder

    Last time I had the following ( for Release build)

    29-06-2015 12:26 10.032.128 Qt5Guid.dll
    13-10-2015 21:56 4.617.728 Qt5Core.dll
    29-06-2015 12:25 4.862.976 Qt5Gui.dll
    29-06-2015 12:33 4.418.560 Qt5Widgets.dll
    15-10-2015 18:56 68.096 myplot.exe
    05-10-2013 02:38 455.328 msvcp120.dll
    21-10-2015 10:58 <DIR> platforms
    05-10-2013 02:38 970.912 msvcr120.dll

    Directory of E:\test\platforms
    29-06-2015 12:36 991.232 qwindows.dll

  • The problem is solved,

    The problem was caused by the difference between Qt SDK compiler and application compiler !

    I recompiled the src of qt sdk with the compiler used to my program and now it work !
    thanx,

  • Понравилась статья? Поделить с друзьями:
  • Python ошибки компиляции
  • Qsqlquery exec database not open ошибка
  • Python ошибка при установке dlib
  • Python ошибка при установке 0x80070659
  • Qt creator ошибка lnk2019