Results 1 to 3 of 3

Thread: Problem using Qt debug frameworks on Mac

  1. #1
    Join Date
    Oct 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    4

    Default Problem using Qt debug frameworks on Mac

    Hello,
    I downloaded and installed qt-sdk-mac-opensource-2009.04.dmg and I'm running Mac OS X 10.6 Snow Leopard.

    I built both debug and release versions of my app and they debug and run fine. I then used this working project as a test to see if I could setup debugging of Qt, but it crashes with errors, presumably due to a problem with my debug frameworks but I'm not sure.

    1. The first thing I did was enable debugging of Qt. I enabled debugging of Qt on Mac based on the help I received in a thread here.

    2. I set a breakpoint in the first line in main and when I run it crashes before I get there.

    Here is the stack trace:

    Qt Code:
    1. 0 __kill 0
    2. 1 kill$UNIX2003 0
    3. 2 raise 0
    4. 3 __abort 0
    5. 4 abort 0
    6. 5 _dispatch_abort 0
    7. 6 dispatch_source_set_cancel_handler 0
    8. 7 ___CFMachPortCreateWithPort2_block_invoke_1 0
    9. 8 dispatch_barrier_sync_f 0
    10. 9 dispatch_sync_f 0
    11. 10 dispatch_sync 0
    12. 11 _CFMachPortCreateWithPort2 0
    13. 12 CFMachPortCreate 0
    14. 13 _CFXNotificationCenterCreate 0
    15. 14 _CFXNotificationGetHostCenter 0
    16. 15 __CFXPreferencesGetSourceForTriplet 0
    17. 16 __CFXPreferencesGetSearchListForBundleID 0
    18. 17 CFPreferencesCopyAppValue 0
    19. 18 _CFBundleCopyUserLanguages 0
    20. 19 _CFBundleAddPreferredLprojNamesInDirectory 0
    21. 20 _CFBundleGetLanguageSearchList 0
    22. 21 CFBundleCopyResourceURL 0
    23. 22 CFBundleGetLocalInfoDictionary 0
    24. 23 CFBundleGetValueForInfoDictionaryKey 0
    25. 24 GetBugsForOurBundleIDFromCoreservicesd 0
    26. 25 _CSCheckFix 0
    27. 26 _Gestalt_SystemVersion 0
    28. 27 Gestalt 0
    29. 28 macVersion qglobal.cpp 1591
    30. 29 __static_initialization_and_destruction_0 qglobal.cpp 1596
    31. 30 global constructors keyed to _Z8qVersionv qglobal.cpp 2745
    32. 31 __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE 0
    33. 32 __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj 0
    34. 33 __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj 0
    35. 34 __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj 0
    36. 35 __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE 0
    37. 36 __dyld__ZN4dyld24initializeMainExecutableEv 0
    38. 37 _start 0
    39. 38 start 0
    To copy to clipboard, switch view to plain text mode 

    Can anybody point me in the right direction to figure out what is wrong here?

    Thanks so much for the help.

    Brett

  2. #2
    Join Date
    Oct 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem using Qt debug frameworks on Mac

    confirmed we were experienced with the same problem under SL. Seems problem not related to Qt actually but to Snow Leopard. Do you use fork() at your application? Follow small sample run on Snow Leopard leads to the same crash:

    #include <netinet/in.h>
    #include <arpa/nameser.h>
    #include <arpa/inet.h>
    #include <resolv.h>
    #include <CoreServices/CoreServices.h>
    #include <iostream>

    using namespace std;

    int main(int argc, char* argv[])
    {
    cout << "Calling Gestalt with gestaltSystemVersion" << endl;

    long response = 0;
    OSErr err = Gestalt(gestaltSystemVersion, &response);
    if (err == noErr)
    cout << "Version returned: " << response << endl;

    cout << "Calling res_init()" << endl;

    res_init();

    cout << "Forking " << endl;

    int pid = fork();
    if (pid != 0)
    {
    cout << "Parent process initiates sleep(20) " << endl;
    char c;
    cin>>c;
    cout << "Parent process done - exiting program." << endl;
    cout << "If you did not see messages about SDK test success, then there is no success!" << endl;
    return 0;
    }

    cout << "Child: sleep(1) - just to ensure that child is running" << endl;

    sleep(1);

    cout << "Calling CFLocaleCopyCurrent() directly" << endl;

    CFLocaleCopyCurrent();

    cout << "Called successfully" << endl;

    return 0;
    }

  3. #3
    Join Date
    Oct 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    4

    Default Re: Problem using Qt debug frameworks on Mac

    Thanks for your post.

    I'm not using fork(), I'm using the standard generated main.cpp that the Qt wizard makes.

    Cheers.

Similar Threads

  1. Problem when triyng to debug
    By Platoon in forum Qt Programming
    Replies: 4
    Last Post: 30th September 2009, 07:54
  2. Unicode Font Display Problem
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd September 2009, 06:11
  3. Problem with Debug mode in KDevelop
    By zlatko in forum KDE Forum
    Replies: 1
    Last Post: 16th June 2006, 09:10
  4. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.