Results 1 to 7 of 7

Thread: Debugging ASSERT failure in Qt header.

  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 Debugging ASSERT failure in Qt header.

    Qt 4.2.3, windows, mingw.

    I'm getting an assert failure from qbytearray.h (qba.at(x) subscript out of range). Is there any way in the mingw environment to determine which function this error is occurring in?

    Thanks,
    Doug

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Debugging ASSERT failure in Qt header.

    could you show us code which can reproduce this bug?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Debugging ASSERT failure in Qt header.

    Quote Originally Posted by Doug Broadwell View Post
    Is there any way in the mingw environment to determine which function this error is occurring in?
    You are referencing a non-existing index of the byte array somewhere in your code. You can use a debugger and print a backtrace to see the list of function calls you are in but in this situation it is much easier to inspect your code, you're probably "off by one" somewhere or you didn't initialize some array properly.

  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: Debugging ASSERT failure in Qt header.

    The problem is I don't know where in my code this is happening and there's a fair bit of it (too many modules, too large to post). I know that the problem is index out of range but placing my own asserts in all locations that access QByteArrays, or objects derived from QByteArrays, would be onerous.

    Is there a GDB (or any other) implementation of a debugger that will run in the windows/mingw environment?

    Thanks

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

    Default Re: Debugging ASSERT failure in Qt header.

    I should have added that the error occurs sometimes but not others and I haven't been able to create a situation that adjusts the frequency of occurrance - or force it to happen.

    Doug

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Debugging ASSERT failure in Qt header.

    GDB works fine under Windows with MinGW.

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

    Default Re: Debugging ASSERT failure in Qt header.

    Thanks!

    I feel like an idiot for not thinking of this myself (old age setting in I'm afraid).

    Doug

Similar Threads

  1. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  2. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21
  3. 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.