Results 1 to 3 of 3

Thread: ASSERT: "bitmap" in file image\qnativeimage.cpp, line 114

  1. #1
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default ASSERT: "bitmap" in file image\qnativeimage.cpp, line 114

    Hi all, I am facing to assertion failed issue in image\qnativeimage.cpp at line 114.

    I use open source QT version 4.7.1 and QTWinMigrate 2.8_1 in standalone MFC application where I can not modify code, so I use QMfcApp.pluginInstance to attach.
    I have looked into call stack and it seems like low memory issue, but I think it is not.

    Problem seems to be that QNativeImage is asked to allocate bitmap of size 32768 * 32768 which is probably too much (you can see it in fallowing call stack).
    Does anybody know how to avoid this issue? Or at least how can I workaround it?

    Follows my call stack:
    QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x10b705a8) Line 2270 C++
    QtCored4.dll!qt_message(QtMsgType msgType=QtFatalMsg, const char * msg=0x672a6a80, char * ap=0x0027e764) Line 2328 + 0x12 bytes C++
    QtCored4.dll!qFatal(const char * msg=0x672a6a80, ...) Line 2511 + 0xf bytes C++
    QtCored4.dll!qt_assert(const char * assertion=0x11ff0314, const char * file=0x11ff02fc, int line=114) Line 2027 + 0x16 bytes C++
    QtGuid4.dll!QNativeImage::QNativeImage(int width=32767, int height=32767, QImage::Format format=Format_RGB32, bool isTextBuffer=false, QWidget * __formal=0x10bc0ce0) Line 114 + 0x1b bytes C++
    QtGuid4.dll!QRasterWindowSurface:repareBuffer(QImage::Format format=Format_RGB32, QWidget * widget=0x10bc0ce0) Line 378 + 0x34 bytes C++
    > QtGuid4.dll!QRasterWindowSurface::setGeometry(cons t QRect & rect={...}) Line 325 C++
    QtGuid4.dll!QWidgetBackingStore::sync() Line 1183 C++
    QtGuid4.dll!QWidgetPrivate::syncBackingStore() Line 1819 C++
    QtGuid4.dll!QWidget::event(QEvent * event=0x10b1a720) Line 8494 C++
    QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver=0x10bc0ce0, QEvent * e=0x10b1a720) Line 4445 + 0x11 bytes C++
    QtGuid4.dll!QApplication::notify(QObject * receiver=0x10bc0ce0, QEvent * e=0x10b1a720) Line 4410 + 0x10 bytes C++
    QtCored4.dll!QCoreApplication::notifyInternal(QObj ect * receiver=0x10bc0ce0, QEvent * event=0x10b1a720) Line 732 + 0x15 bytes C++
    QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x10bc0ce0, QEvent * event=0x10b1a720) Line 215 + 0x39 bytes C++
    QtCored4.dll!QCoreApplicationPrivate::sendPostedEv ents(QObject * receiver=0x00000000, int event_type=0, QThreadData * data=0x0df77258) Line 1373 + 0xd bytes C++
    QtCored4.dll!QCoreApplication::sendPostedEvents(QO bject * receiver=0x00000000, int event_type=-1) Line 1266 + 0x11 bytes C++
    QtWinMigrate-2.8d.dll!QtFilterProc(int nCode=0, unsigned int wParam=1, long lParam=2618184) Line 105 + 0x10 bytes C++

    Thanks in advance,
    Dusan
    Last edited by DusanDusan; 22nd May 2012 at 21:26.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: ASSERT: "bitmap" in file image\qnativeimage.cpp, line 114

    That assertion seems to be because Windows is not returning a valid device context from a call to CreateCompatibleDC(). Since nothing in the stack back trace relates to your code we have no way of knowing what triggered this situation.

  3. #3
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ASSERT: "bitmap" in file image\qnativeimage.cpp, line 114

    Hi, thanks for reply.

    DC returned seems to be correct (hdc is not NULL), but CreateDIBSection returns NULL, so Q_ASSERT(bitmap) invokes this.

    My QDialog is right before this assertion hidden by its non QT parent set using Win32 API function SetParent. I can not influence the way how is my widget attached. All I had to do is return HWND of my window.

    QT is open source, may I try to repair this issue? I found that some more people on internet had the same issue without solutions.

    What is the source of values width=32767 height=32767? For me those seems to be Maximum size, but it is too much to allocate so it fails.

    Dusan

Similar Threads

  1. Replies: 1
    Last Post: 5th February 2011, 21:14
  2. ASSERT: "w->testAttribute(Qt::WA_WState_Created)"
    By majcia in forum Qt Programming
    Replies: 5
    Last Post: 16th December 2010, 15:42
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Replies: 1
    Last Post: 10th March 2008, 17:51

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.