Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugger thread dump confusion



> Any ideas how to find the offending code (even though I know it's a
> duff reference when the UTF8String message is sent to the null ref
> user)?  Shouldn't it show:
> 
> 0 - objc_msgSend
> 1 - main
> 2 - start

Well, actually no, or maybe ;-)

- In Objective-C it's legal to send messages to nil. You might or might not
get a useful return value (IIRC the rule is that if the method returns an
object you get back nil, but if the method returns a C type the return is
undefined. Even worse, there are cases where on PPC the 0'ish value will be
returned, but not on Intel.)

- So if user were a nil string, you'd more likely bomb inside printf, having
passed it either NULL or a random value as the char *.

- But is user really nil? Isn't it the address of the NSFullUserName
function? In which case, you're back to bombing in the obc_msgSend because
the user value does not point to a valid string...


-- 
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden

References: 
 >Debugger thread dump confusion (From: Chris Smith <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.