Results 1 to 4 of 4

Thread: Problem debugging Assert failure.

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem debugging Assert failure.

    gdb 6.8, Qt 4.2.3, MinGW environment

    I'm getting an Assert failure in qbytearray.h (becausing somewhere I'm doing a .at() with an invalid index). I'm trying to catch it in console based gdb to be able to look at the stack trace to see from whence it has come. The gdb manual recommends breaking on __raise_exception for gnu c++, but gdb couldn't find that symbol; breaking on 'throw' also doesn't work.

    Any suggestions on how to break on throwing an Assert error in Qt files?

    Thanks, Doug

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem debugging Assert failure.

    Using linux, I just run the program (debug build) in gdb and in case of an assert, it stops right there. Then I just hit "bt" in gdb and know the culprit.

  3. #3
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem debugging Assert failure.

    I'm running in Windows and after the assert 'bt' states to the effect that 'there is no stackframe', the app apparantly has already exited when gdb gets control back.

  4. #4
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem debugging Assert failure.

    I finally found a way to do it for anyone else with this problem, I set breakpoints on qFatal(). Worked great.

    Doug

  5. The following user says thank you to Doug Broadwell for this useful post:

    Cruz (12th April 2012)

Similar Threads

  1. Debugging ASSERT failure in Qt header.
    By Doug Broadwell in forum Qt Programming
    Replies: 6
    Last Post: 27th December 2008, 01:40
  2. Problem debugging Windows QT App w/ GDB
    By JDTexas in forum Qt Programming
    Replies: 4
    Last Post: 2nd March 2008, 08:02
  3. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  4. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21
  5. QWT assert failure
    By Andimat in forum Qwt
    Replies: 1
    Last Post: 21st June 2007, 14:36

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.