Re: Application crashing on PowerPC
Re: Application crashing on PowerPC
- Subject: Re: Application crashing on PowerPC
- From: Bill Monk <email@hidden>
- Date: Fri, 11 Feb 2011 11:33:58 -0600
> The font name passed to GetFNum is (pascal string) "Helvetica".
What's the value of the pointer being passed as the familyID param? I suspect some issue (possibly introduced during your port to Intel? or to PowerPlant for OS X?) that now results in a bad pointer being passed to GetFNum, but only in the PPC build.
If GetFNum sees something like GetFNum( "\pHelvetica", 0x0 ) it will crash. Try logging the pointer before the call, or replace it with FMGetFontFamilyFromName(), which has different calling semantics:
fontNum = FMGetFontFamilyFromName( "\pFontName" );
instead of
GetFNum ( "\pFontName|, possibyBogusPointer );
To test this idea, I took a large-ish app here which began life pre-Carbon, ported to Carbon, and is now hybrid Cocoa-Carbon. It uses FMGetFontFamilyFromName, not GetFNum, but all calls are bottlenecked through a utility function, so it's easy to change that one occurrence to GetFNum. And the app still works fine. I don't think there's anything wrong with GetFNum.
But if I deliberately pass it a bad pointer
GetFNum( fontName, (short *)0xdead );
I get a Rosetta a crash that looks suspiciously like yours:
---------------------------
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000dead
Thread 2: Crashed (0xb7fffa04, 0xb80d5e03)
0x98c15960: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD : _GetFNum + 24
---------------------------
and on an actual PPC:
---------------------------
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x0000dead
Thread 0 Crashed:
0 com.apple.QD 0x9174f4fc GetFNum + 24
1 com.redacted.redacted 0x00067a98 MyGetFontNumber + 64
2 com.redacted.redacted 0x000897f8 get_font_number + 60
---------------------------
> I suspect that this error is related to something that's not set up right in my Xcode
Hmm... I never used PowerPlant on Intel much, but your crash log contains UReanimator and stuff like that. Doesn't that mean you're still using PPob files rather than converting them to XML with PPobToXML? If so, OS X maps Resource Manager files into memory by default, making them read-only. And often enough, Carbon ports don't like that. You might need to add
CSResourcesFileMapped NO
to your Info.plist.
HTH
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden