[Qt-interest] The pains of debugging on Windows - Random 'ASSERT' crash on the QList [] operator

Andre Somers andre at familiesomers.nl
Tue Dec 8 09:45:06 CET 2009


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.

André




More information about the Qt-interest-old mailing list