[Interest] QResourceRoot::findNode Crash on OS X

Jason A. Donenfeld Jason at zx2c4.com
Thu Feb 2 04:59:17 CET 2012


Hello Qt-Interest,

I have an application that at some point calls

        QFile file(":/MyProgram.ui");
        file.open(QFile::ReadOnly);

These lines cause this segfault on OS X:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000fd05de65
0x00000001037da399 in QResourceRoot::findNode ()
(gdb) bt
#0  0x00000001037da399 in QResourceRoot::findNode ()
#1  0x00000001037dad13 in QResourcePrivate::load ()
#2  0x00000001037db070 in QResourcePrivate::ensureInitialized ()
#3  0x00000001037db5d4 in QResource::isCompressed ()
#4  0x00000001037db7ba in QResourceFileEngine::QResourceFileEngine ()
#5  0x00000001037db933 in QResourceFileEngineHandler::create ()
#6  0x000000010373287d in QAbstractFileEngine::create ()
#7  0x00000001037c204c in QFile::fileEngine ()
#8  0x00000001037380fd in QFile::open ()
#9  0x00000001000453b3 in doSomethingElse () at SomePlace.cpp:120
#10 0x0000000100045a22 in doSomething () at SomePlace.cpp:142
#11 0x000000010001a4c5 in MyApplication::setup (this=0x7fff5fbff490) at
MyApplication.cpp:419
#12 0x000000010002b289 in crashmain (argc=@0x7fff5fbff8dc,
argv=0x7fff5fbff948) at Main.cpp:71
#13 0x000000010002b7e9 in main (argc=1, argv=0x7fff5fbff948) at Main.cpp:110
#14 0x00000001000121ba in _start () at qatomic_x86_64.h:135
#15 0x00000001000120d9 in start () at qatomic_x86_64.h:135

The application makes use of shared libraries for functionality, and the
shared library as well as the main executable has its own resource files.
If the shared library does not have resources compiled in, this problem
does not occur.

This problem does not exist on Linux or Windows.

Evidently the two resource loads are stepping on each others' memory
spaces. Does anyone know how to make them play nicely with each other? Or
is this simply not possible, and I will instead have to put all my
resources in a single place?

Thank you,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120202/62eb5948/attachment.html>


More information about the Interest mailing list