PDA

View Full Version : Problem using Qt debug frameworks on Mac



bibbinator
19th October 2009, 03:34
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 (http://www.qtcentre.org/forum/f-qt-programming-2/t-how-to-set-dyld-image-suffix-debug-in-mac-24838.html).

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:



0 __kill 0
1 kill$UNIX2003 0
2 raise 0
3 __abort 0
4 abort 0
5 _dispatch_abort 0
6 dispatch_source_set_cancel_handler 0
7 ___CFMachPortCreateWithPort2_block_invoke_1 0
8 dispatch_barrier_sync_f 0
9 dispatch_sync_f 0
10 dispatch_sync 0
11 _CFMachPortCreateWithPort2 0
12 CFMachPortCreate 0
13 _CFXNotificationCenterCreate 0
14 _CFXNotificationGetHostCenter 0
15 __CFXPreferencesGetSourceForTriplet 0
16 __CFXPreferencesGetSearchListForBundleID 0
17 CFPreferencesCopyAppValue 0
18 _CFBundleCopyUserLanguages 0
19 _CFBundleAddPreferredLprojNamesInDirectory 0
20 _CFBundleGetLanguageSearchList 0
21 CFBundleCopyResourceURL 0
22 CFBundleGetLocalInfoDictionary 0
23 CFBundleGetValueForInfoDictionaryKey 0
24 GetBugsForOurBundleIDFromCoreservicesd 0
25 _CSCheckFix 0
26 _Gestalt_SystemVersion 0
27 Gestalt 0
28 macVersion qglobal.cpp 1591
29 __static_initialization_and_destruction_0 qglobal.cpp 1596
30 global constructors keyed to _Z8qVersionv qglobal.cpp 2745
31 __dyld__ZN16ImageLoaderMachO18doModInitFunctionsER KN11ImageLoader11LinkContextE 0
32 __dyld__ZN11ImageLoader23recursiveInitializationER KNS_11LinkContextEj 0
33 __dyld__ZN11ImageLoader23recursiveInitializationER KNS_11LinkContextEj 0
34 __dyld__ZN11ImageLoader23recursiveInitializationER KNS_11LinkContextEj 0
35 __dyld__ZN11ImageLoader15runInitializersERKNS_11Li nkContextE 0
36 __dyld__ZN4dyld24initializeMainExecutableEv 0
37 _start 0
38 start 0


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

Thanks so much for the help.

Brett

sandro78
29th October 2009, 15:46
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;
}

bibbinator
5th November 2009, 08:50
Thanks for your post.

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

Cheers.