Compiled and build with MinGW 20120426, Qt 4.8.2: QApplication crashes on Windows 7



  • Hi to all,

    i have MinGW 20120426 and Qt 4.8.2.
    I managed to compile and build my project using this Qt and MinGW's gcc (4.7.1)

    After i collect all *.dll in same directory i try to start my executable and it crashes.

    A little of manual instrumentation of a source gives me place where it crashes: QApplication app( argc, argv );

    I ran under GDD. Here is the output.

    Program received signal SIGSEGV, Segmentation fault.
    0x6e1cc9a4 in ZN23QCoreApplicationPrivate27processCommandLineArgumentsEv ()
    from c:\Work\CUBE4\cube-4.1.1\vpath_nsis_install\bin\QtCore4.dll
    (gdb) backtrace
    #0 0x6e1cc9a4 in ZN23QCoreApplicationPrivate27processCommandLineArgumentsEv
    () from c:\Work\CUBE4\cube-4.1.1\vpath_nsis_install\bin\QtCore4.dll
    #1 0x6e1ccf44 in ZN16QCoreApplication4initEv ()
    from c:\Work\CUBE4\cube-4.1.1\vpath_nsis_install\bin\QtCore4.dll
    #2 0x6e1cd297 in ZN16QCoreApplicationC2ER23QCoreApplicationPrivate ()
    from c:\Work\CUBE4\cube-4.1.1\vpath_nsis_install\bin\QtCore4.dll
    #3 0x6771806f in ZN12QApplicationC1ERiPPci ()
    from c:\Work\CUBE4\cube-4.1.1\vpath_nsis_install\bin\QtGui4.dll
    #4 0x00535f9c in _fu966___ZSt4cout ()
    #5 0x0028ff30 in ?? ()
    #6 0x004010fd in __mingw_CRTStartup ()
    #7 0x00000000 in ?? ()

    My non GUI (hence non Qt ) programs run smoothless.
    I tried to run as an administrator: same result.

    Who knows solution? Why it crashes and what should i do? Under linux/mac project compiles, builds, and runs errorless.

    Thanx,
    System.dat-User.dat



  • Try check for missing dll by Dependency Walker.



  • Dependency Walker stated, that i need IEShims.dll -> copied from Interned Explorer Directory once, and from windows another time -> same result, it crashes.

    GDB reports same stack backtrace after crash. So, IEShims.dll doesn't matter.
    Besides of that -> all .dll are there.

    Dependency Walker reports as well, that "Module with different CPU were found" -> well, my non QT tools have same error (mixed CPU x64 and x86), but they run properly.


    Additionally: I check Event Reporter of Windows
    and have error code of the crash: 0xc00000005

    According to http://www.updatexp.com/0xC0000005.html, it is some Memory Access violation error. But why in QApplication and why seems that only me who has it, no another similar bug reports found...
    Some drivers?


    Additionlly: recompiled with --enable-auto-import according to: http://www.qtcentre.org/threads/44540-qt-4.7.4-linking-error-missing-enable-auto-import
    -> same result



  • I've the same problem.

    Installed Qt 4.8.3, with MinGW GCC 4.6.2 everything is fine.

    If I upgrade GCC to 4.7.2, a simple program like this one

    @
    #include <QApplication>

    int main(int argc, char **argv)
    {
    QApplication app(argc,argv);

    return app.exec();
    }
    @

    causes a crash here:
    @
    QCoreApplicationPrivate::processCommandLineArguments (this=0x3c4278) at kernel/qcoreapplication.cpp:230

    if (argv[i] && *argv[i] != '-') {
    @

    The problem is argc. I don't know why, but it has a random value (my last run reports 3949040), and of course the loop containing the above code accesses out of memory boundaries.

    Is there anything in GCC 4.7.2 that can spoil the build? I know about issues regarding ABI GCC 4.7.0 and 4.7.1, but 4.7.2 should have been C++98 compatible.

    T.


  • Moderators

    Code produced by GCC 4.7 is binary-incompatible with code produced by GCC 4.4.

    The MinGW version of Qt 4.8.3 was built with GCC 4.4, so you can't link your programs to it if you build with GCC 4.7



  • Thank you. All is well after downgrading to gcc-4.4.

    (4.4 not even available anymore via mingw-get install "package-name=version-spec") :/



  • There's no need to move so back in version ... 4.6.2 is enough. And you can use also many (not all) C++11 features! :)



  • oh, thanks. upgrading again... :D



  • Anyway, if you need GCC 4.7.x series, you can also download Qt sources and build them. Also in this case everything is working fine.


  • Moderators

    Problem solved but just to clarify the "Module with different CPU were found” output the DW gives - it's a long story but the short version is that this happens when you check your win32 app with x64 version of DW or x64 app with win32 DW or have e.g win32 Qt libs in PATH and use x64 DW.
    Just keep them all in line to avoid it.
    The IEShims.dll is a bogus warning, no neeed to include it with your app.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.