I’m in the process of porting my SDL game to Mac OS X. I’ve been able to get
it running on my own Mac without any problems, but a user is reporting that
the game always crashes right on startup. I’ve been able to locate the crash
to this:
IF SDL_INIT(SDL_INIT_AUDIO) < 0 THEN BEGIN
WriteToLog(‘Error: Unable to initialize SDL audio!’);
SDL_Quit;
Exit;
END;
If I take out the audio initializaion, it works perfectly (until the game
tries to play music, of course). Here’s the trace back from the user:
Date/Time: 2008-09-15 18:29:00.571 -0600
OS Version: 10.4.11 (Build 8S165)
Report Version: 4
Command: asciisec
Path: /Volumes/Bob/asciisector/Privateer - Ascii Sector/Privateer - Ascii
Sector.app/Contents/MacOS/asciisec
Parent: WindowServer [101]
Version: ??? (???)
PID: 14890
Thread: 0
Exception: EXC_ARITHMETIC (0x0003)
Code[0]: 0x00000003
Code[1]: 0xc6002090
Thread 0 Crashed:
0 …audio.toolbox.AudioToolbox 0x9421c3c4
SincKernel::CalculateFilterCoefficients(double) + 596
1 …audio.toolbox.AudioToolbox 0x9428c018
SincKernelFactory::ReferenceSincKernel(double, int, int) + 152
2 …audio.toolbox.AudioToolbox 0x9428bed0 Resampler2::Resampler2[unified]
(double, double, int) + 628
3 …audio.toolbox.AudioToolbox 0x9421bfc0
Resampler2Wrapper::Resampler2Wrapper[unified](SampleRateConverter*, int,
double, double, int) + 168
4 …audio.toolbox.AudioToolbox 0x9421bea4
SampleRateConverter::SetConverterQuality(unsigned long) + 104
5 …audio.toolbox.AudioToolbox 0x9421be10
SampleRateConverter::SampleRateConverter[unified](StreamDescPair const&) + 244
6 …audio.toolbox.AudioToolbox 0x94218be8
PCMConverterFactory::BuildConverterChain(StreamDescPair const&,
AudioConverterChain*, PCMConverterFactory*) + 704
7 …audio.toolbox.AudioToolbox 0x94217df8 ConverterRegistry::CreateConverter
(StreamDescPair const&, AudioConverterChain**, unsigned long,
AudioClassDescription*) + 104
8 …audio.toolbox.AudioToolbox 0x94217754 AudioConverterNew + 356
9 …pple.audio.units.Components 0x700c96b8 0x70000000 + 825016
10 …pple.audio.units.Components 0x700c9938 0x70000000 + 825656
11 …pple.audio.units.Components 0x7000778c DefaultOutputAUEntry + 23004
12 …pple.audio.units.Components 0x70006f48 DefaultOutputAUEntry + 20888
13 …pple.audio.units.Components 0x70004934 DefaultOutputAUEntry + 11140
14 …pple.audio.units.Components 0x70006efc DefaultOutputAUEntry + 20812
15 …pple.audio.units.Components 0x70006e8c DefaultOutputAUEntry + 20700
16 …pple.audio.units.Components 0x70005018 DefaultOutputAUEntry + 12904
17 …pple.audio.units.Components 0x70004e94 DefaultOutputAUEntry + 12516
18 …pple.audio.units.Components 0x700d1d9c 0x70000000 + 859548
19 …ple.CoreServices.CarbonCore 0x90bdcb88 CallComponent + 260
20 …apple.audio.units.AudioUnit 0x9432b5fc AudioUnitInitialize + 32
21 SDL 0x300380ec SDL_HasRDTSC + 3924
22 SDL 0x300023a4 SDL_OpenAudio + 864
23 SDL_mixer 0x32017f64 Mix_OpenAudio + 116
24 …hristianknudsen.asciisector 0x00038710 TOOLBOX_PROGRAMSTART + 1840
(toolbox.pas:495)
25 …hristianknudsen.asciisector 0x0021c448 P$ASCIISEC_STARTGAME + 56
(asciisec.pas:411)
26 …hristianknudsen.asciisector 0x0021c9a4 PASCALMAIN + 52
(asciisec.pas:508)
27 …hristianknudsen.asciisector 0x00282c48
SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR + 40
28 …hristianknudsen.asciisector 0x00003630 -[SDLMain
applicationDidFinishLaunching:] + 76
29 com.apple.Foundation 0x92bf1a5c _nsnote_callback + 180
30 com.apple.CoreFoundation 0x90805ec0 __CFXNotificationPost + 368
31 com.apple.CoreFoundation 0x907fdf20 _CFXNotificationPostNotification + 684
32 com.apple.Foundation 0x92bdbe64 -[NSNotificationCenter
postNotificationName:object:userInfo:] + 92
33 com.apple.AppKit 0x937b2be8 -[NSApplication _postDidFinishNotification] +
112
34 com.apple.AppKit 0x937b2ad4 -[NSApplication
_sendFinishLaunchingNotification] + 92
35 com.apple.AppKit 0x937b261c -[NSApplication(NSAppleEventHandling)
_handleAEOpen:] + 264
36 com.apple.AppKit 0x937b21c4 -[NSApplication(NSAppleEventHandling)
_handleCoreEvent:withReplyEvent:] + 92
37 com.apple.Foundation 0x92bf2a68 -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 380
38 com.apple.Foundation 0x92bf28c8 _NSAppleEventManagerGenericHandler + 92
39 com.apple.AE 0x914fe960 aeDispatchAppleEvent(AEDesc const*, AEDesc*,
unsigned long, unsigned char*) + 208
40 com.apple.AE 0x914fe7fc dispatchEventAndSendReply(AEDesc const*, AEDesc*) +
44
41 com.apple.AE 0x914fe654 aeProcessAppleEvent + 284
42 com.apple.HIToolbox 0x932ad2e0 AEProcessAppleEvent + 60
43 com.apple.AppKit 0x937b090c _DPSNextEvent + 856
44 com.apple.AppKit 0x937b03f8 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
45 com.apple.AppKit 0x937ac93c -[NSApplication run] + 472
46 …hristianknudsen.asciisector 0x00003c7c main + 1316
47 …hristianknudsen.asciisector 0x000024ec _start + 760
48 …hristianknudsen.asciisector 0x000021f0 start + 48
Any ideas on what is causing this problem?