Results 1 to 6 of 6

Thread: Release version crashes, debug version runs as expected

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Release version crashes, debug version runs as expected

    It could be an uninitialized variable which gets initialized to a sane value in debug mode.
    J-P Nurmi

  2. #2
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Talking Re: Release version crashes, debug version runs as expected

    This is called the Heisenberg Principle. It origins from physics (see the wikipedia entry: http://en.wikipedia.org/wiki/Uncertainty_principle). The idea is that when want to measure a system, you insert a probe to measure it, and thus you change the system. It applies to software as well (read the Popular culture part of the wikipedia entry for more "implementations" of this principle).

    The application crashes due to a race condition, you put a
    Qt Code:
    1. printf()
    To copy to clipboard, switch view to plain text mode 
    which changes the internal timings (or compile in debug mode, which might be slower, faster, or just different), different commands get scheduled differently - oops, no problem

    Now the fun part of my responce: good luck, you will need it.

  3. #3
    Join Date
    Aug 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Release version crashes, debug version runs as expected

    I have a similar problem. Works on debug, but no on release. To make it special, this happens on linux. On windows it's the other way around. I've yet to find any reason for this behavior. My solution ends up being this:

    win32 {
    CONFIG += release
    }

    linux-g++ {
    CONFIG += debug
    }

    I also run strip on the app on linux to get a smaller size for it. It's not always 0s and 1s...

    Good luck, but don't wast to much time on this quest. It might not be worth it.

  4. #4
    Join Date
    Jul 2008
    Location
    East Coast, USA
    Posts
    40
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    6
    Thanked 2 Times in 1 Post

    Thumbs up Solved

    Thanks for your replies guys.

    I solved it by basically going back and rewriting the thread more cleanly, so that its behavior to stochastic (i.e. user) input is more robust.

    I don't know what the exact problem was, but the code looks prettier now and, it works both in debug and release!

    -Kaushik

Similar Threads

  1. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  2. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  3. Replies: 15
    Last Post: 21st April 2007, 17:46
  4. Replies: 6
    Last Post: 10th November 2006, 10:38

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.