• 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: Why would a working -[NSInvocation invoke] call NSBeep() ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would a working -[NSInvocation invoke] call NSBeep() ?


  • Subject: Re: Why would a working -[NSInvocation invoke] call NSBeep() ?
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 04 Dec 2011 18:05:10 -0800

On Dec 4, 2011, at 5:49 PM, Jerry Krinock <email@hidden> wrote:

> At one point, running in Mac OS 10.7, one of my invocations gets invoked, and …
>
> #0    0x913761fa in NSBeep
> #1    0x9b6f0e1d in __invoking___
> #2    0x9b6f0d59 in -[NSInvocation invoke]
> #3    0x976458ea in __NSFireDelayedPerform
> #4    0x9b6b0996 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
> …
>
> Everything works perfectly except that the stupid beep is annoying.
>
> The invocation targets NSApplication with selector -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:.  I looked at it in gdb using "Mac OS X Debugging Magic".  The target, selector, and arguments all look fine.
>
> The sheet appears before the beep.  The method -[NSInvocation invoke] shows 92 lines of assembly code.  It looks like, indeed, the actual invocation is done first, and then at line 41 it calls this __invoking__ thing, which is 48 lines of assembly code, and for some reason at line 15 it calls NSBeep().
>
> Does anyone have any idea why -[NSInvocation invoke] might call NSBeep()?

Tail-call elimination is probably eliding a bunch of stack frames that would reveal why NSBeep() is being called. NSInvocation doesn't wrap plain C function calls.

--Kyle Sluder_______________________________________________

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

References: 
 >Why would a working -[NSInvocation invoke] call NSBeep() ? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Why would a working -[NSInvocation invoke] call NSBeep() ?
  • Next by Date: Re: I've Got Those NSKeyedUnarchiver Blues!
  • Previous by thread: Why would a working -[NSInvocation invoke] call NSBeep() ?
  • Next by thread: Re: Why would a working -[NSInvocation invoke] call NSBeep() ?
  • Index(es):
    • Date
    • Thread