[Qt-interest] The pains of debugging on Windows - Random 'ASSERT' crash on the QList [] operator
william.crocker at analog.com
william.crocker at analog.com
Tue Dec 8 13:11:33 CET 2009
Andre Somers wrote:
> Josiah Bryan wrote:
>
>> I apologize for the vagueness of this post - I'll get the exact message
>> next time I'm at the location. However, I've been vexed by this problem
>> this week and I'm trying to reproduce the problem on Linux - to no avail.
>>
>> Bottom line: The program I'm using randomly crashes with an assert
>> failure on the [] operator saying something about index out of range,
>> IIRC. The thing is, this on Windows, and when I run it in the Qt Creator
>> debugger, after the assert failure, no stack is available to see where
>> the failure came from. I have not tried running it under the command
>> line gdb yet on windows - but the last time I did under gdb (for a
>> different problem), the stack came back looking like:
>>
>> 0x038512 blah blah /blah/kernel.dll
>> 0x029381 ?? ()
>> 0x082385 ?? ()
>> ...
>>
>> E.g. no stack info for anything in my code or in Qt (Yes, it was a debug
>> build!)
>>
>> So, my main methods of debugging - gdb and Qt Creator - both seem to be
>> useless. (common problem on windows I've experienced, not just with this
>> problem.) For any serious debugging, I've used Linux + gdb - works great
>> when it crashes. However, I can't get it to crash on Linux, no matter
>> how much fuzzing I throw at it, no matter how I try to re-create the
>> problem. So I'm left debugging on windows.
>>
>> Anyone have any suggestions on how to better use the built-in Qt Creator
>> debugger when the program randomly crashes, or get 'gdb' on the command
>> line showing useful stack info?
>>
>> Thanks for your time everyone.
>>
>>
> I know where you're comming from; I run into similar issues sometimes
> myself.
> There is a switch you can use to turn on fatal warnings. In your run
> environment, define the QT_FATAL_WARNINGS variable. That has helped me
> sometimes. Still, I wish there was a way to make ASSERTS go away and
> just trigger a proper crash I can debug.
>
>
Install your own message handler with qInstallMsgHandler and then set a
break there or
call a special, empty function named stop_here() from your message
handler and
from all "throw" contexts to give you one convenient place to set a
break point for all.
> André
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list