🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #1059

Re: App crashes on object declaration

#1059
From: meeroh
Date: Sat, 09 Mar 2002 05:21
56 lines
3008 bytes
In article <080320021615353314%wadesworld@mac.com>,
 Wade Williams <wadesworld@mac.com> wrote:

>I've got an application which uses a carbonized GUSI.  When the app
>makes a simple call to fopen(), which GUSI overrides, the app crashes
>on an object declaration.  (Note that under Classic I've used GUSI in
>this project fine, and the author of the Carbon version of GUSI uses it
>without problem)
>
>The error occurs when it's attempting to create an instance of
>GUSIErrorSaver.  It does not actually enter the constructor.
>
>// The next calls also need the services of [[GUSIDeviceRegistry]].
>[[open]] used
>// both the [[GUSIDeviceRegistry]] and the [[GUSIDescriptorTable]].
>//
>// <POSIX function wrappers>=
>int   open(const char * path, int mode, ...)
>{
>   GUSIErrorSaver       saveError;    <<-----error occurs right here
>   GUSIDeviceRegistry * factory  = GUSIDeviceRegistry::Instance();
>   GUSIDescriptorTable *   table = GUSIDescriptorTable::Instance();
>   GUSISocket *         sock;
>   int                  fd;
>
>and here it is in mixed source / assembly:
>
>{
>004EFC60: 7C0802A6  mflr     r0
>004EFC64: BEA1FFD4  stmw     r21,-44(SP)
>004EFC68: 90010008  stw      r0,8(SP)
>004EFC6C: 9421FF90  stwu     SP,-112(SP)
>004EFC70: 90610088  stw      r3,136(SP)
>004EFC74: 9081008C  stw      r4,140(SP)
>004EFC78: 90A10090  stw      r5,144(SP)
>004EFC7C: 90C10094  stw      r6,148(SP)
>004EFC80: 90E10098  stw      r7,152(SP)
>004EFC84: 9101009C  stw      r8,156(SP)
>004EFC88: 912100A0  stw      r9,160(SP)
>004EFC8C: 914100A4  stw      r10,164(SP)
>004EFC90: 3BC26C74  addi     r30,RTOC,27764
>004EFC94: 83E287B8  lwz      r31,-30792(RTOC)
>   GUSIErrorSaver       saveError;
>004EFC98: 801F0000  lwz      r0,0(r31)  <--error occurs here - r31 ==
>0x00000000

From what I see here it seems that the ctor is inlined or you have  
other optimizations on. You should try turning off all optimizations and 
inlining to see whether that makes it clearer what line of code you are 
crashing on.

hth

meeroh
-- 
Hire me: <http://meeroh.org/hire.html>
Technical Details
Message-ID: <macdev-4EBA9F.00215609032002@senator-bedfellow.mit.edu>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mail
References: <080320021615353314%wadesworld@mac.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,1f46dffbdfb01bf7
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,1f46dffbdfb01bf7
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-03-08 21:21:57 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mail
From: meeroh <macdev@meeroh.org>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Mail-Copies-To: poster
Subject: Re: App crashes on object declaration
Organization: MIT
References: <080320021615353314%wadesworld@mac.com>
User-Agent: MT-NewsWatcher/3.1 (PPC)
Date: Sat, 09 Mar 2002 00:21:56 -0500
Message-ID: <macdev-4EBA9F.00215609032002@senator-bedfellow.mit.edu>
Lines: 56
NNTP-Posting-Host: NEON-20.MIT.EDU
X-Trace: 1015651315 senator-bedfellow.mit.edu 3930 18.101.0.201