
Originally Posted by
jacek
Maybe Dr Watson/Dr Mingw will help to locate the method that tries to do that?
Yes.
I know that method )
Output:
First-chance exception at 0x67054768 (QtCored4.dll) in OpenGLHashBug.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
Unhandled exception at 0x67054768 (QtCored4.dll) in OpenGLHashBug.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
Call stack:
QtCored4.dll!QHashData::nextNode(QHashData::Node * node=0x0114d420) Line 203 + 0x3 bytes QtOpenGLd4.dll!QHash<QString,QCache<QString,QGLTex ture>::Node>::const_iterator:
perator++() Line 372 + 0xc bytes
QtOpenGLd4.dll!QHash<QString,QCache<QString,QGLTex ture>::Node>::keys() Line 603
QtOpenGLd4.dll!QCache<QString,QGLTexture>::keys() Line 89 + 0x1f bytes
QtOpenGLd4.dll!qt_gl_clean_cache(const QString & cacheKey={...}) Line 1606 + 0xf bytes
QtOpenGLd4.dll!qt_gl_image_cleanup(__int64 key=0x0000005900000000) Line 1626 + 0x39 bytes
QtGuid4.dll!QImage::detach() Line 1303 + 0x10 bytes
QtGuid4.dll!QPainter::begin(QPaintDevice * pd=0x04edff2c) Line 1286
QtGuid4.dll!QPainter::QPainter(QPaintDevice * pd=0x04edff2c) Line 1056
OpenGLHashBug.exe!ImageRenderer::run() Line 81 + 0xd bytes
QtCored4.dll!QThreadPrivate::start(void * arg=0x01132770) Line 220
msvcr80d.dll!_callthreadstartex() Line 348 + 0xf bytes
msvcr80d.dll!_threadstartex(void * ptd=0x0114afd0) Line 331
Function in qhash.cpp:
...
QHashData::Node *QHashData::nextNode(Node *node)
{
union {
Node *next;
Node *e;
QHashData *d;
};
next = node->next;
Q_ASSERT_X(next, "QHash", "Iterating beyond end()");
if (next->next) // <<-- Error is here
return next;
int start = (node->h % d->numBuckets) + 1;
Node **bucket = d->buckets + start;
int n = d->numBuckets - start;
while (n--) {
if (*bucket != e)
return *bucket;
++bucket;
}
return e;
}
QHashData::Node *QHashData::nextNode(Node *node)
{
union {
Node *next;
Node *e;
QHashData *d;
};
next = node->next;
Q_ASSERT_X(next, "QHash", "Iterating beyond end()");
if (next->next) // <<-- Error is here
return next;
int start = (node->h % d->numBuckets) + 1;
Node **bucket = d->buckets + start;
int n = d->numBuckets - start;
while (n--) {
if (*bucket != e)
return *bucket;
++bucket;
}
return e;
}
To copy to clipboard, switch view to plain text mode
Sometimes I have another call stack:
QtCored4.dll!q_atomic_increment(volatile int * ptr=0xfeeefeee) Line 149 + 0xb bytes
QtCored4.dll!QBasicAtomic::ref() Line 73 + 0x10 bytes
QtCored4.dll!QString::QString(const QString & other={...}) Line 648 + 0x3e bytes
QtOpenGLd4.dll!QList<QString>::append(const QString & t={...}) Line 402 + 0xd bytes
QtOpenGLd4.dll!QHash<QString,QCache<QString,QGLTex ture>::Node>::keys() Line 602
QtOpenGLd4.dll!QCache<QString,QGLTexture>::keys() Line 89 + 0x1f bytes
QtOpenGLd4.dll!qt_gl_clean_cache(const QString & cacheKey={...}) Line 1606 + 0xf bytes
QtOpenGLd4.dll!qt_gl_image_cleanup(__int64 key=0x0000010100000000) Line 1626 + 0x39 bytes
QtGuid4.dll!QImage::detach() Line 1303 + 0x10 bytes
QtGuid4.dll!QPainter::begin(QPaintDevice * pd=0x04faff2c) Line 1286
....
and another one exception in near that place:
First-chance exception at 0x67054768 (QtCored4.dll) in OpenGLHashBug.exe: 0xC0000005: Access violation reading location 0x00000001. // <<-- Access in freed pointer (0x00000000) + 1, e.g. freed object/structure.
Call stack:
QHashData::nextNode(QHashData::Node * node=0x01c36a28) Line 203 + 0x3 bytes
QHash<QString,QCache<QString,QGLTexture>::Node>::c onst_iterator:
perator++() Line 372 + 0xc bytes
QHash<QString,QCache<QString,QGLTexture>::Node>::k eys() Line 603
QCache<QString,QGLTexture>::keys() Line 89 + 0x1f bytes
qt_gl_clean_cache(const QString & cacheKey={...}) Line 1606 + 0xf bytes
qt_gl_image_cleanup(__int64 key=0x000002f600000000) Line 1626 + 0x39 bytes
QImage::detach() Line 1303 + 0x10 bytes
QPainter::begin(QPaintDevice * pd=0x0500ff2c) Line 1286
QPainter::QPainter(QPaintDevice * pd=0x0500ff2c) Line 1056
ImageRenderer::run() Line 81 + 0xd bytes
QThreadPrivate::start(void * arg=0x01c02770) Line 220
That's why is think that Image::detach() method is not protected by mutex
Bookmarks