Important: Please read the Qt Code of Conduct -

Mysterious crash on Mac

  • Hi,

    I have an app written in Qt 4.8.4 that is crashing mysteriously on the Mac, apparently when the Mac wakes up. I can't reproduce the problem myself, but several users have reported the same problem, although it seems to happen infrequently.

    The relevant bit of the crash log appears below.

    It appears to be due to a 'QNSListener' not having a 'notificationHandler' selector, but I can find no docs anywhere on QNSListener.

    Anyone else heard of this problem? Is there any solution?

    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000

    Application Specific Information:
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[QNSListener notificationHandler:]: unrecognized selector sent to instance 0x600000041560'
    terminating with uncaught exception of type NSException
    abort() called

    Application Specific Backtrace 1:
    0 CoreFoundation 0x00007fff9680464c __exceptionPreprocess + 172
    1 libobjc.A.dylib 0x00007fff8ff126de objc_exception_throw + 43
    2 CoreFoundation 0x00007fff968076bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3 CoreFoundation 0x00007fff9674ea84 forwarding + 1028
    4 CoreFoundation 0x00007fff9674e5f8 _CF_forwarding_prep_0 + 120
    5 CoreFoundation 0x00007fff967c0cbc CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
    6 CoreFoundation 0x00007fff966b21b4 _CFXNotificationPost + 3140
    7 libdispatch.dylib 0x00007fff8818c323 _dispatch_call_block_and_release + 12
    8 libdispatch.dylib 0x00007fff88187c13 _dispatch_client_callout + 8
    9 libdispatch.dylib 0x00007fff8818a88f _dispatch_root_queue_drain + 935
    10 libdispatch.dylib 0x00007fff88198fe4 _dispatch_worker_thread3 + 91
    11 libsystem_pthread.dylib 0x00007fff8ea286cb _pthread_wqthread + 729
    12 libsystem_pthread.dylib 0x00007fff8ea264a1 start_wqthread + 13

  • Lifetime Qt Champion


    QNSListener is an internal class used only the CoreWlan related code. On what version of OS X are they experiencing this ?

  • @marksibly said:

    It appears to be due to a 'QNSListener' not having a 'notificationHandler' selector

    Do you package the plugin bearer/libqcorewlanbearer.dylib ?

    This is where -[QNSListener notificationHandler:] is defined.

  • On what version of OS X are they experiencing this ?

    Seems to be a Yosemite problem.

    Do you package the plugin bearer/libqcorewlanbearer.dylib ?

    No I don't, I just use macdeployqt which doesn't appear to copy it in.

    I can't actually find the file libqcorewlanbearer.dylib anywhere on my Mac either, but spotlight appears to be doing something weird so it may actually be there somewhere.

    My Qt install is also a bit of a mess - I've had to do all sorts of weird crap over time so Qt can find compilers etc. I guess there's no easy way to uninstall/reinstall everything Qt related.

  • Ok, I eventually found libqcorewlanbearer.dylib in /Developer/Applications/Qt/plugins/bearer/. There's also libqgenericbearer.dylib there.

    Does this sound like the correct location for a 4.8.4 lib?

    Should I just copy it into to app package Frameworks dir along with other dylibs?

  • Ok, the bearers/ stuff WAS being deployed - I just hadn't checked the PlugIns dir.

    However, my app is not doing this:

    qApp->setLibraryPath(qApp->applicationDirPath() + "/../PlugIns");

    With a bit of luck, that could be the problem!

  • Well, after trying this trick...

    $ ./ looks like libqcorewlanbearer.dylib and all other plugins are being correctly loaded from the app's PlugIns dir after all.

    Any other ideas?

Log in to reply