PDA

View Full Version : Qt 4.4 on Mac OS X - app crashes with NSInvalidArgumentException



krzemin
15th February 2009, 22:53
I'm deploying an application on Mac OS X written in Qt4. Under Qt 4.3.x all works fine, but when I try to use Qt 4.4.3 application crashes:



$ ./QNapi
2009-02-15 23:45:50.435 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1d2e0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x9221b1f1 0x9221b25d 0x9221b2b1 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.436 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1e5a0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x959f564a 0x9221b27d 0x9221b2b1 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.436 QNapi[55424:10b] *** -[NSCFBoolean length]: unrecognized selector sent to instance 0xa02a8400
2009-02-15 23:45:50.438 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1eaa0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x9221b1f1 0x9221b25d 0x9221b2f1 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.439 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1e820 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x959f564a 0x9221b27d 0x9221b2f1 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.439 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1e850 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x959f564a 0x9221b312 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.439 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1d0b0 of class NSException autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x9221b342 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.440 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1e2b0 of class _NSCallStackArray autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x95a44078 0x9221414b 0x910ede3b 0x9221b34a 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.441 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1ef30 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x959f564a 0x922140ce 0x910ede3b 0x9221b34a 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.441 QNapi[55424:10b] *** _NSAutoreleaseNoPool(): Object 0xc1ee50 of class NSCFData autoreleased with no pool in place - just leaking
Stack: (0x95addadf 0x959ea1f2 0x959fe8c5 0x959fe4a1 0x922140e2 0x910ede3b 0x9221b34a 0x9221994c 0x92219a12 0x921b1b57 0x724e4b 0xd1807 0x80c43 0x80e4b 0x2c020 0x28baf 0x669a 0x5d52 0x5c79)
2009-02-15 23:45:50.441 QNapi[55424:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFBoolean length]: unrecognized selector sent to instance 0xa02a8400'
2009-02-15 23:45:50.443 QNapi[55424:10b] Stack: (
2451652939,
2433670715,
2451682122,
2451675468,
2451675666,
2451250007,
7491147,
858119,
527427,
527947,
180256,
166831,
26266,
23890,
23673
)
Trace/BPT trap
$


I've tried both Qt dmg installer and own static Qt compilation with the same result. Any ideas?

talk2amulya
15th February 2009, 23:06
hey mate, all i know is that exception is thrown when some invalid argument is passed into a function..prolly sm function in 4.3.x has changed in 4.4.3

krzemin
15th February 2009, 23:52
Thanks for your quick response :)

But I have really no idea what argument of what function could be invalid. I have commented out all code from main() except QApplication app(..) and app.exec(). Debuger says that application is interrupted at creating QApplication object. There is no crash when I use QCoreApplication instead of QApplication.

ayoy
20th February 2009, 00:42
Hey,

there's everything allright with your app. The only problem is with your Info.plist file, and customising LSUIElement property - "Application is agent(UIElement)". The same happens to me when I try to customize it. Regardless of the value (true or false) this setting causes application to crash badly. When these lines are removed from Info.plist file:


<key>LSUIElement</key>
<true/>

my application works, and so does yours (I've checked it :)). Unfortunately, the application icon is then visible in dock, and you also get the unnecessary menu bar, but I guess this is the only way to get things working. I didn't find any solution to this problem so far, and neither did google. Just one trace (http://github.com/soc88/avogadro/commit/08515f7b7af95d4626fc6ddb8077e6280fd865ed) of this issue, where guys gave up...

ayoy
20th February 2009, 13:40
I've just checked with Qt 4.5 release candidate, and this setting works! :)

krzemin
5th March 2009, 01:38
I've compiled app in Qt 4.5.0 stable without applying any changes in this area and all works fine :) No ugly crash and no dock icon is visible. It seems it was bug in Qt 4.4.x.