Results 1 to 20 of 29

Thread: Complicated QwtPlotZoomer crash, possible bug? Help request.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Complicated QwtPlotZoomer crash, possible bug? Help request.

    Hi guys,
    I have a really annoying bug in my program that is hard to track down.
    The situation is that when I repeatedly zoom in/out/in/out many times, at a certain point the program crashes. It looks like parts of the GUI are placed all over the desktop until after another couple of clicks windows reports an error and you have to end the program.
    The point at where it crashes is unknown, but it does seem to crash quicker when a PC has less memory; i.e. the more memory, the longer it will take to crash. On a 512mB PC it takes about 20 zooms and on a 1G PC it must take around 80 or something (those are a complete guess though!).
    I dont mean this in any disrespectful way because I think Qwt is excellent, and I use it all the time, but I've checked my program and I dont think that there is anywhere for my program to cause the crash, since all the data is passed to the plot via the setData function. So I can only assume that there is a pointer/allocation related bug somewhere in the QwtPlotZoomer code.

    If you have any thoughts/questions I will be glad to help.
    Best Regards,
    Phil Winder
    www.philwinder.com

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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

  3. #3
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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
    Best Regards,
    Phil Winder
    www.philwinder.com

  4. #4
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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:
    Qt Code:
    1. convertHIconToPixmap(), failed to GetIconInfo()
    2. QPixmap::fromWinHBITMAP(), failed to get bitmap info (The handle is invalid.)
    3. QPixmap::fromWinHBITMAP(), failed to get bitmap info (The handle is invalid.)
    To copy to clipboard, switch view to plain text mode 
    When in debug mode I get:
    Qt Code:
    1. Program exited with code 03.
    2. (gdb)
    3. QFSFileEngine::open: No file name specified
    4. convertHIconToPixmap(), failed to GetIconInfo()
    5. QPixmap::fromWinHBITMAP(), failed to get bitmap info (The handle is invalid.)
    6. QPixmap::fromWinHBITMAP(), failed to get bitmap info (The handle is invalid.)
    7. ASSERT: "m_hdc" in file painting\qpaintengine_raster.cpp, line 4286
    8.  
    9. This application has requested the Runtime to terminate it in an unusual way.
    10. Please contact the application's support team for more information.
    11. warning: Lowest section in C:\WINDOWS\system32\xpsp2res.dll is .rsrc at 00011000
    12. warning: Lowest section in C:\WINDOWS\system32\odbcint.dll is .rsrc at 00401000
    13. BFD: C:\WINDOWS\system32\wmvcore.dll: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .reloc
    14. BFD: C:\WINDOWS\system32\wmvcore.dll: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .reloc
    15. (gdb)
    To copy to clipboard, switch view to plain text mode 
    Best Regards,
    Phil Winder
    www.philwinder.com

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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

  6. #6
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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,
    Best Regards,
    Phil Winder
    www.philwinder.com

  7. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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

  8. #8
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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.
    Attached Files Attached Files
    Best Regards,
    Phil Winder
    www.philwinder.com

  9. #9
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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

  10. #10
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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.
    Best Regards,
    Phil Winder
    www.philwinder.com

  11. #11
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Complicated QwtPlotZoomer crash, possible bug? Help request.

    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
    Best Regards,
    Phil Winder
    www.philwinder.com

Tags for this Thread

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.