Start your debugger and tell us about the stack, when your application has crashed. If you think you are running out of memory use a memory profile ( f.e. valgrind on Linux ).
Without additional informations you can't expect any useful hint.
Uwe
Start your debugger and tell us about the stack, when your application has crashed. If you think you are running out of memory use a memory profile ( f.e. valgrind on Linux ).
Without additional informations you can't expect any useful hint.
Uwe
Ok I'll try, but I havent got Qt installed for debugging so I will have to go and sort that out. I also have no idea how to look at the stack, so I'm afraid you will have to give me a while to get to grips!
Cheers,
Phil
Hi Uwe,
Ive now had some time to look into this further. Below are the error messages I received.
When in release mode, the QT console returns:
When in debug mode I get:Qt Code:
convertHIconToPixmap(), failed to GetIconInfo()To copy to clipboard, switch view to plain text mode
Qt Code:
Program exited with code 03. (gdb) convertHIconToPixmap(), failed to GetIconInfo() ASSERT: "m_hdc" in file painting\qpaintengine_raster.cpp, line 4286 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. warning: Lowest section in C:\WINDOWS\system32\xpsp2res.dll is .rsrc at 00011000 warning: Lowest section in C:\WINDOWS\system32\odbcint.dll is .rsrc at 00401000 BFD: C:\WINDOWS\system32\wmvcore.dll: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .reloc BFD: C:\WINDOWS\system32\wmvcore.dll: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .reloc (gdb)To copy to clipboard, switch view to plain text mode
Well, only starting the gdb is not enough, you have to analyse the stack after the crash. F.e. enter "where" to see the stack. With "up" and "down" you can navigate on the stack and check the local variables.
Uwe
Hi Uwe,
Ok I tried, but when I typed "where" it said there was no stack. Is that because the program has ended?
Because I dont know where the crash is occuring, so I can't stop it just before it ends.
Thanks,
Guess you were running on an exception that terminated the program. If true catch the exception in the debugger an look at your stack then.
I'm afraid you have to spend some time on the gdb manual - but this time is definitely not wasted.
Uwe
Hi again Uwe,
I've been doing some more research on this bug, and although I couldnt find it via debugging (hard work!) I did manage to replicate the bug in a simple program.
The code attached was compiled with Qt 4.4.3 and the Qwt from the svn repository which I believe was Revision 417: version 5.2.
To get the program to crash, you have to use your mouse to zoom in and out many times. I believe the faster you zoom in and out, the faster it will crash. So I was repeatedly left clicking then right clicking at a fair pace. Make sure to do small circles too so it actually zooms in. (Note: this may cause your hand to ache!).
On a Dual core 2GHz laptop with 2G of RAM, it takes about 1.5 minutes to crash. On lower spec PC's (tested with a P4 3GHz, 512Mb RAM) it can sometimes only take 30 seconds worth of clicking.
Hopefully you can compile and run the attached code, but if you have any problems let me know.
Many thanks,
Phil Winder
Attached: qwtCrashTest.zip - source files, ui file and a pro file.
I've tried your demo on Linux/X11 with Qwt 5.1/Qt 4.4.2 without problems.
But your demo code does not much, so you can expect, that the reason for it is Qt downwards and Windows specific.
I recommend to upgrade to Qt 4.4.3 build it in debug mode and rerun your demo under gdb control. And again: try to learn/understand your debugger - whenever an applicaton crashes you can see it in your debugger.
Uwe
As stated in the above post, it was compiled in 4.4.3, so I cannot update any more.
But yes, it does seem to be windows specific.
A quick update, unfortunately, I still haven't got round to debugging the code, but the crash is applicable to all of Qwt's examples with a zoom in. E.g. Bode, errorbars, etc.
It crashes on Xp and Vista.
I'll try and find some time to go through it this week. Hopefully. Debugging somebody else's code is a nightmare!
Cheers,
Phil
Phil, I didn't mean, that you should debug someones code. Believe me its completely impossible to understand ( I never tried myself ) the graphics pipeline of Qt without spending a lot of time before.
What you know is that Qt is running into an assertion in qpaintengine_raster.cpp, line 4286. Obviously CreateCompatibleDC(displayDC); returns NULL, what is the return value, when the method fails. Maybe its worth to read the MSDN docs (or google) about CreateCompatibleDC.
The assertion might have to do with the warnings before. If those are written immediately before the assertion ( do they happen in all Qwt examples too) try to find the code line, that writes them.
If you have a support license this should be enough information to contact the TrollTech support.
Uwe
Hi Uwe,
I've spent a bit of time looking thought the debug window and yes, the crash is due to the Assert statement. CreateCompatibleDC is some sort of memory management function, so I can only assume that it cannot allocate the memory for the device.
I dont know why it cant allocate the memory though, because according to my memory gauge there is loads left.
Do you think that this is a Qt problem? Or a windows problem? Its obviously not something to do with Qwt (How could I ever think it was!) but I am an open source user, and hence have no service contract. Shall I attempt to report a bug?
Cheers,
Phil
Bookmarks