• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fixing logged error that doesn't throw exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing logged error that doesn't throw exception


  • Subject: Re: Fixing logged error that doesn't throw exception
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 27 May 2009 20:40:10 -0500

On May 27, 2009, at 7:15 PM, Graham Cox wrote:

I'm getting this in the log when I open the "Customize Toolbar" sheet:

-[NSConcreteAttributedString initWithString:] called with nil string argument. This has undefined behavior and will raise an exception in post-Leopard linked apps. This warning is displayed only once.

Is this a bug in the frameworks or in my code?

Probably your code. Presumably Apple has tried to eliminate all instances of this bug in their own code.


I tried setting a symbolic breakpoint on this but it doesn't fire at all, though if it did I'm not sure how I'd make it conditional on the string being nil as there are no debugging symbols.

You could test the location on the stack which holds the parameter. On x86, that's:


	*(id*)($ebp + 16)

You can also use DTrace:

sudo dtrace -n 'objc$target:NS*AttributedString:initWithString?:entry / arg2==0/ {ustack();}' -p <pid>

(arg0 is 'self', arg1 is '_cmd', so arg2 is the first non-hidden method parameter.)

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Fixing logged error that doesn't throw exception
      • From: Graham Cox <email@hidden>
References: 
 >Fixing logged error that doesn't throw exception (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Wacky Text View Glyph Rending Bug
  • Next by Date: Re: Abstract class with single subclass
  • Previous by thread: Re: Fixing logged error that doesn't throw exception
  • Next by thread: Re: Fixing logged error that doesn't throw exception
  • Index(es):
    • Date
    • Thread