Debug build works on Panther, but not Release build...

Sage
Posts: 1,199
Joined: 2004.10
Post: #1
Subject says it all. My game, which runs great on Tiger ( both the Debug and Release build versions ), only runs on Panther in Debug build mode. It doesn't even make it far enough to open a window.

The backtrace I get on Panther isn't particularly useful, since the Release build has debug symbols stripped, but it's failing in my code ( not any system code as far as I can tell ). Specifically, it's failing in the constructor of my primary game controller object's super class ( which is basically just a singleton which provides global access to the game state, scene graph, physics engine, sound manager, etc ).

Looking at the crashlog ( below ) the only suspect part is the "????" before the reference to OpenAL, which I downloaded from Creative's CVS, and built on Tiger, with the @executable_path set to be the bundle's Frameworks folder.

If OpenAL were the problem, I'd *assume* the Debug build wouldn't work, either. But it does.

Any ideas?


Code:
Date/Time:      2005-06-22 13:27:53 -0400
OS Version:     10.3.9 (Build 7W98)
Report Version: 2

Command: Legion
Path:    /Volumes/zakariya/Projects/Legion/build/Deployment/Legion.app/Contents/MacOS/Legion
Version: ??? (1.0)
PID:     27534
Thread:  0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xfffeff00

Thread 0 Crashed:
0   <<00000000>>     0xfffeff00 0 + 0xfffeff00
1   org.zakariya.legion     0x00064b78 Legion::GameWorld::GameWorld() + 0x1c (crt.c:355)
2   org.zakariya.legion     0x000abb6c Legion::LegionGame::LegionGame() + 0x24 (crt.c:355)
3   org.zakariya.legion     0x000a779c -[GSApplication init] + 0x58 (crt.c:355)
4   com.apple.AppKit        0x92f528ac +[NSApplication sharedApplication] + 0xac
5   com.apple.AppKit        0x92f69b58 NSApplicationMain + 0x13c
6   org.zakariya.legion     0x00008820 _start + 0x158 (crt.c:272)
7   org.zakariya.legion     0x000086c4 start + 0x3c

PPC Thread State:
  srr0: 0xfffeff00 srr1: 0x4200f030                vrsave: 0x00000000
    cr: 0x84000422  xer: 0x00000000   lr: 0x000a770c  ctr: 0x90008b20
    r0: 0x000a76f8   r1: 0xbffffb50   r2: 0x8fe507cc   r3: 0xa0a36170
    r4: 0x9089bc0c   r5: 0x00000000   r6: 0x00008bff   r7: 0x42b99f98
    r8: 0x000ee597   r9: 0x00000040  r10: 0x1e6493d7  r11: 0x00123a93
   r12: 0x000f4240  r13: 0x00000000  r14: 0x00000000  r15: 0x00000000
   r16: 0x00000000  r17: 0xa2e92800  r18: 0xa2e72800  r19: 0xa2ea2800
   r20: 0xa2ea2800  r21: 0x90897e40  r22: 0x0062c000  r23: 0x00000000
   r24: 0x00235410  r25: 0x00000000  r26: 0x0060d180  r27: 0x00630bf0
   r28: 0x00630bcc  r29: 0x00630b60  r30: 0x00630b60  r31: 0x00000000

Binary Images Description:
    0x1000 -   0x1e9fff org.zakariya.legion ??? (1.0)    /Volumes/zakariya/Projects/Legion/build/Deployment/Legion.app/Contents/MacOS/Legion
  0x529000 -   0x53ffff ??? OpenAL version 1.0.8d1 (1.0.1d1)    /Volumes/zakariya/Projects/Legion/build/Deployment/Legion.app/Contents/MacOS/../Frameworks/OpenAL.framework/Versions/A/OpenAL
0x80830000 - 0x8090efff libxml2.2.dylib     /usr/lib/libxml2.2.dylib
0x80a50000 - 0x80ad4fff libstdc++.6.dylib     /usr/lib/libstdc++.6.dylib
0x80c80000 - 0x80c88fff libgcc_s.1.dylib     /usr/lib/libgcc_s.1.dylib
0x81f20000 - 0x81f23fff libmx.A.dylib     /usr/lib/libmx.A.dylib
0x86eb7000 - 0x86ef7fff com.apple.glut 3.2.7 (GLUT-3.2.7)    /System/Library/Frameworks/GLUT.framework/Versions/A/GLUT
0x8fe00000 - 0x8fe4ffff dyld     /usr/lib/dyld
0x90000000 - 0x9014ffff libSystem.B.dylib     /usr/lib/libSystem.B.dylib
0x901c0000 - 0x9026dfff com.apple.CoreFoundation 6.3.7 (299.35)    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x902b0000 - 0x90529fff com.apple.CoreServices.CarbonCore 10.3.7    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x90584000 - 0x905f3fff com.apple.framework.IOKit 1.3.6 (???)    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90610000 - 0x9069afff com.apple.CoreServices.OSServices 3.0.1    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x90700000 - 0x90700fff com.apple.CoreServices 10.3 (???)    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x907f0000 - 0x907f9fff com.apple.DiskArbitration 2.0.5    /System/Library/PrivateFrameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x90810000 - 0x90810fff com.apple.ApplicationServices 1.0 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x90830000 - 0x9089ffff libobjc.A.dylib     /usr/lib/libobjc.A.dylib
0x908c5000 - 0x90915fff com.apple.HIServices 1.4.1 (0.0.1d1)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x90940000 - 0x909b3fff com.apple.DesktopServices 1.2.5    /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x909f0000 - 0x90a04fff libCGATS.A.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
0x90a20000 - 0x90b7bfff com.apple.Foundation 6.3.7 (500.59)    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x90c60000 - 0x90cc2fff libGLU.dylib     /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x90d00000 - 0x90d1bfff com.apple.SystemConfiguration 1.7.1 (???)    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x90d2c000 - 0x90d43fff com.apple.LangAnalysis 1.5.4    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x90d60000 - 0x90d6bfff com.apple.opengl 1.3.8    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x90d8b000 - 0x90da5fff libGL.dylib     /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x90daf000 - 0x90daffff com.apple.audio.units.AudioUnit 1.3.3    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x90ec0000 - 0x90ec0fff com.apple.Cocoa 6.3 (???)    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x910b0000 - 0x91101fff com.apple.bom 1.2.5 (63.2)    /System/Library/PrivateFrameworks/Bom.framework/Versions/A/Bom
0x9110d000 - 0x91174fff com.apple.audio.CoreAudio 2.1.3    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x911d2000 - 0x911dffff com.apple.CommonPanels 1.2.1 (1.0)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x913a0000 - 0x9145ffff ColorSync     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x915e0000 - 0x91699fff com.apple.QD 3.4.67 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x916e0000 - 0x91773fff com.apple.print.framework.PrintCore 3.3    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x91810000 - 0x9182afff com.apple.openscripting 1.2.1 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x91850000 - 0x91860fff com.apple.ImageCapture 2.1.5    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x918d0000 - 0x918dcfff com.apple.help 1.0.1    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x918f0000 - 0x9193efff com.apple.print.framework.Print 3.3    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x91a40000 - 0x91ab3fff com.apple.NavigationServices 3.3.3    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x91b10000 - 0x91b2afff libPDFRIP.A.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libPDFRIP.A.dylib
0x91b50000 - 0x91b5ffff libPSRIP.A.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libPSRIP.A.dylib
0x91b80000 - 0x91b93fff libRIP.A.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x91de2000 - 0x91e1afff com.apple.AE 1.4    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x92056000 - 0x92061fff com.apple.securityhi 1.2 (90)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x920c0000 - 0x922a7fff com.apple.security 2.4 (177)    /System/Library/Frameworks/Security.framework/Versions/A/Security
0x92430000 - 0x92468fff com.apple.LaunchServices 10.3.5 (98.4)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x9273f000 - 0x9276dfff libssl.0.9.7.dylib     /usr/lib/libssl.0.9.7.dylib
0x9278f000 - 0x927b5fff com.apple.FindByContent 1.4 (1.2)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
0x927c8000 - 0x927d3fff libCSync.A.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x927f0000 - 0x92827fff com.apple.CFNetwork 1.2.1 (7)    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x9283f000 - 0x92852fff com.apple.speech.synthesis.framework 3.2    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x92880000 - 0x92c05fff com.apple.HIToolbox 1.3.6 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x92e70000 - 0x9336ffff com.apple.AppKit 6.3.8 (743.39)    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x93920000 - 0x93930fff com.apple.speech.recognition.framework 3.3    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x939a0000 - 0x939b4fff libcups.2.dylib     /usr/lib/libcups.2.dylib
0x93a50000 - 0x93a54fff libmathCommon.A.dylib     /usr/lib/system/libmathCommon.A.dylib
0x93b2d000 - 0x93b35fff libbsm.dylib     /usr/lib/libbsm.dylib
0x942cf000 - 0x942ecfff com.apple.audio.SoundManager 3.9    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x94610000 - 0x9462afff libresolv.9.dylib     /usr/lib/libresolv.9.dylib
0x94640000 - 0x94649fff libz.1.dylib     /usr/lib/libz.1.dylib
0x946e0000 - 0x9473ffff com.apple.SearchKit 1.0.2    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x947b3000 - 0x947cbfff com.apple.WebServices 1.1.1 (1.1.0)    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
0x94800000 - 0x9488cfff com.apple.ink.framework 101.1.4 (55.12)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x949ba000 - 0x949bafff com.apple.Carbon 10.3 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x94ea0000 - 0x954a6fff libBLAS.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x95500000 - 0x957d0fff libLAPACK.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x958e0000 - 0x95900fff libvMisc.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x95b50000 - 0x95c32fff libicucore.A.dylib     /usr/lib/libicucore.A.dylib
0x95e40000 - 0x95eadfff libvDSP.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x95f30000 - 0x9601efff libiconv.2.dylib     /usr/lib/libiconv.2.dylib
0x96a20000 - 0x96ae2fff libcrypto.0.9.7.dylib     /usr/lib/libcrypto.0.9.7.dylib
0x96b50000 - 0x96bdffff ATS     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x96e80000 - 0x96e90fff com.apple.vecLib 3.0.3 (vecLib 3.0.3)    /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x96eca000 - 0x96f82fff com.apple.audio.toolbox.AudioToolbox 1.3.3    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x96fe8000 - 0x9724afff com.apple.QuickTime 7.0.1    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
0x97335000 - 0x9739efff com.apple.htmlrendering 1.1.2    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x97915000 - 0x97bedfff com.apple.CoreGraphics 1.203.30 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #2
Maybe try compiling it with GCC 3.3 instead of 4.0? I think OSC mentioned in some other thread that GCC 4.0 had some problems with it.

Edit: Here's the thread I was thinking about.

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #3
I just gave that a shot. Didn't work, though. Annoyed
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #4
You may be running into an unitialized variable problem here, at least the symptoms are typical. The debug and release versions may have different contents of the unitialised variable, and that's why you might see that.

It would probably help if we could see the code noted (crt.c?) in that crashlog.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #5
Unfortunately, crt.c is the file that always gets mentioned when an executable built in release mode crashes, at least on my systems. E.g., if the *Debug* build had crashed, I'd know where and why. But the debug build works.

The Release build -- with no debug symbols -- runs fine on Tiger, but crashes on Panther.

Here's GameWorld's constructor:
Code:
GameWorld::GameWorld( void ):
    _currentState(0),
    _videoSettings( new VideoSettings ),
    _keyboardSettings( new KeyboardSettings ),
    _autoDeletionStack( "GameWorldADS" ),
    _timer( 0.25 )
{
    GameObject::setTimestep( UpdateInterval );
    Screenshot::setPreferredFormat( Screenshot::JPEG );
}

Here's the constructor of the class "LegionGame" which inherits from GameWorld.

Code:
LegionGame::LegionGame( void )
    :_world(0), _space(0), _contactGroup(0),
    _stage(0), _player(0), _hud(0), _fpsWidget(0), _traceView(0),
    _level(-1),
    _shadowMethod( VideoSettings::ShadowMethod_Additive ),
    _mainMenuState(0), _loadingState(0), _keyboardSettingsState(0),
    _videoSettingsState(0), _playingState(0), _pausedState(0), _gameOverState(0),
    _tesselatorTestState(0), _explosionTestState(0),
    _keyScreenshot(-1)
{
    PANSICore::Logger::instance()->addListener( new GameLogListener( std::cout ) );

    videoSettings()->addSettingsListener( this );
    keyboardSettings()->addSettingsListener( this );
}

And, finally, here's where LegionGame is created, in -(void) init for my subclass of NSApplication. Note, this was adapted from OneSadCookie's GameShell.

Code:
- (id)init
{
    self = [super init];
    if (self == nil)
    {
        return nil;
    }
    
    _modifierFlags = 0;
    _firstMouseMovement = YES;

    /*
        LegionGame is both a GameWorld and a GameController,
        thanks to multiple inheritance.
    */

    Legion::LegionGame *game = new Legion::LegionGame;

    Legion::GameWorld::setInstance( game );
    GSSetGameController( game );
        
    return self;
}
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  News: Game development MMO in the works diablosandwicheater 0 2,413 Mar 13, 2012 10:33 AM
Last Post: diablosandwicheater
  Build for 10.3.9 maximile 3 3,894 Jun 19, 2011 12:13 PM
Last Post: OneSadCookie
  xcode build optimizations NelsonMandella 5 6,547 Jul 24, 2009 06:39 AM
Last Post: Oddity007
  Handy build rule tip for iPhone devs Skorche 3 3,004 Jul 23, 2009 09:44 AM
Last Post: Skorche
  XCode doesn't realize a library has changed unless you force your project to build. XSTNX 6 5,484 Jun 8, 2009 10:25 AM
Last Post: XSTNX