Results 1 to 2 of 2

Thread: MSVC 2010 and Qt 4.7.3 handling of assert()'s on custom GL windows problem

  1. #1
    Join Date
    Apr 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default MSVC 2010 and Qt 4.7.3 handling of assert()'s on custom GL windows problem

    We are using Qt with VS 2010 (latest SP available), and the current issue is, when a assert() is hit, it causes weird behavior from Qt.

    Normally, when a assert() is hit, you get the standard assert dialog popup from MSVC's debugger.
    Well, now, instead of getting that standard assert dialog popup, after Qt is init, and shows no errors, it goes into Qt's paint routine to try to do something, and crashes in our custom draw routines, since (in this case) we haven't even set those up yet.

    assert(0); //works as it should (standard assert dialog shows)
    {init Qt's GL context}
    assert(0); //fails, and crashes in our routines. (no standard assert dialog is ever shown)

    Warzone2100-Dbg.exe!WzMainWindow::paintGL() Line 274 C++
    QtOpenGLd4.dll!QGLWidget::glDraw() Line 4484 C++
    QtOpenGLd4.dll!QGLWidget::updateGL() Line 4030 C++
    Warzone2100-Dbg.exe!WzMainWindow::tick() Line 120 + 0x12 bytes C++
    Warzone2100-Dbg.exe!WzMainWindow::qt_metacall(QMetaObject::Cal l _c, int _id, void * * _a) Line 72 + 0x8 bytes C++
    QtCored4.dll!QMetaObject::metacall(QObject * object, QMetaObject::Call cl, int idx, void * * argv) Line 238 C++
    QtCored4.dll!QMetaObject::activate(QObject * sender, const QMetaObject * m, int local_signal_index, void * * argv) Line 3278 + 0x27 bytes C++
    QtCored4.dll!QTimer::timeout() Line 128 + 0x12 bytes C++
    QtCored4.dll!QTimer::timerEvent(QTimerEvent * e) Line 273 C++
    QtCored4.dll!QObject::event(QEvent * e) Line 1182 C++
    QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver, QEvent * e) Line 4462 + 0x11 bytes C++
    QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3862 + 0x10 bytes C++
    QtCored4.dll!QCoreApplication::notifyInternal(QObj ect * receiver, QEvent * event) Line 731 + 0x15 bytes C++
    QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 215 + 0x39 bytes C++
    QtCored4.dll!QEventDispatcherWin32::event(QEvent * e) Line 1139 + 0x10 bytes C++
    QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver, QEvent * e) Line 4462 + 0x11 bytes C++
    QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3862 + 0x10 bytes C++
    QtCored4.dll!QCoreApplication::notifyInternal(QObj ect * receiver, QEvent * event) Line 731 + 0x15 bytes C++
    QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 215 + 0x39 bytes C++
    QtCored4.dll!QCoreApplicationPrivate::sendPostedEv ents(QObject * receiver, int event_type, QThreadData * data) Line 1372 + 0xd bytes C++
    QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 497 + 0x10 bytes C++
    ...
    msvcr100d.dll!__crtMessageBoxW(const wchar_t * lpText, const wchar_t * lpCaption, unsigned int uType) Line 158 + 0x13 bytes C
    msvcr100d.dll!_wassert(const wchar_t * expr, const wchar_t * filename, unsigned int lineno) Line 308 + 0x16 bytes C
    Anyone have any clue on why Qt appears to be hijacking the normal crtMessageBoxW() call, perhaps via its own handler routines ?
    This is highly strange behavior.

    Qt 4.7.3 was compiled for VS2010 as well.

    Any ideas on what is going on ?

  2. #2
    Join Date
    Apr 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MSVC 2010 and Qt 4.7.3 handling of assert()'s on custom GL windows problem

    It looks like the reason for this was, that we have a timer function that calls updateGL(), which in turn calls paintGL(), and when the assert hits, the timer is still calling updateGL().

    Ugh. I really hate these kind of bugs.

Similar Threads

  1. MSVC 2010 Binary for Qt
    By pssss in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2011, 00:24
  2. Qt 4.7.0 source compilation errors (MSVC 2010, Windows 7 Ultimate 64-bit)
    By andrey.khaletsky in forum Installation and Deployment
    Replies: 3
    Last Post: 30th September 2010, 09:16
  3. Plan for Visual Studio 2010 (MSVC 2010)?
    By Vinzz in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2010, 18:42
  4. Problem with compiling Qt 4.6 via MSVC 2010 Beta2 (win32-msvc specs)
    By Erik-Moscow in forum Installation and Deployment
    Replies: 2
    Last Post: 17th December 2009, 19:44
  5. Possible to compile Qt 4.5 source with msvc 2010 beta?
    By JimDaniel in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd July 2009, 15:19

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
  •  
Qt is a trademark of The Qt Company.