Results 1 to 4 of 4

Thread: application crash problem

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default application crash problem

    I have a typical problem with QT creator (1.2.1 based on QT4.5.2)

    1) when i run my application using ctrl+r (free run), I crashes (unhandled expection)
    2) when i run with using F5 (attaching a debugger) , it runs fine.

    This is same for both debug and release build.

    So as i can conclude
    1) it is not a debug or release build issue, as usig F5 button , application runs fine in both build
    2) it is a problem related to attaching the debugger to application , because using F5 button you are attaching the debugger to your application. while with Ctrl+r (free run ) you don't . and application only crashes in latter case.

    Can somebody help to analyze how to solve it.

  2. #2
    Join Date
    Sep 2009
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: application crash problem

    I know exactly how to solve your problem:

    1) for some reason the run in debug mode knows where to look for the dll's, and the free run as you describe it doesn't.
    2) to solve the crash: copy the QtCore4.dll, QtGui4.dll and other libs you link against to the same directory as the .exe file. No more problem

  3. #3
    Join Date
    Dec 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: application crash problem

    No this is not the problem, as the application start running and crashes after some time.

    Infact i figured out the solution.

    The basic difference between free run (Ctrl+R) and debug run (F5, i.e. debugger attached ) is teh use of heap.
    When the debugger is attached , system uses DEBUG HEAP.

    In order to have same behaviour you can stop using the debugger use the debug heap , set the environment variable _NO_DEBUG_HEAP = 1.

    The your will be able to produce the same crash with pressing F5 key, i.e. running with debugger attached.

  4. #4
    Join Date
    Sep 2009
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: application crash problem

    Oh ok, I assumed it was a crash on startup... guess it's a logical/programming error in your code if it crashes at some point after loading libs... Can't help there if there's no code to debug

    PS: I also noticed that windows throws no out-of-bounds exceptions when in debug mode... which is pretty sh*tty when you think everything works until you build a release version and you get a cryptic runtime exception

Similar Threads

  1. problem with deploying static application in windows
    By remy06 in forum Installation and Deployment
    Replies: 3
    Last Post: 2nd June 2009, 06:46
  2. Replies: 0
    Last Post: 2nd September 2008, 04:29
  3. getting problem in running qtopia home screen application
    By afgan_rajesh in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st January 2008, 07:01
  4. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.