• 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: Hang/crash into assembly code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hang/crash into assembly code


  • Subject: Re: Hang/crash into assembly code
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 16 Jul 2011 10:23:52 -0700

On Jul 16, 2011, at 9:54 AM, Fritz Anderson wrote:

> Your main thread is hung on a semaphore in a window-resize view animation. Some other thread must be holding the semaphore.

Tip: You can use the pop-up above the stack trace to switch between threads. Look at them and see if you’ve got app code in the backtrace in any of them.

Alternatively, I find the ‘sample’ tool (or the Sample command in Activity Monitor) very useful in looking at hung apps, since it dumps every thread’s stack at once. Or from the gdb prompt in Xcode you can type “thread apply all bt”.

> Here is the first place I'd look: AppKit (and therefore essentially all of your human-interface tasks) is not thread-safe. Have you set up any threads? Are you doing any drawing, window operations, etc., from a background thread?


Yup. Be very, very, very careful about making any AppKit calls from background threads. It’s nearly always better to delegate UI activity to the main thread, and there are a wealth of tools for letting your background threads message back to the main thread when they’ve completed work or need to display something.

—Jens_______________________________________________

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: 
 >Hang/crash into assembly code (From: Adam Gerson <email@hidden>)
 >Re: Hang/crash into assembly code (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: strange NSTextView problem
  • Next by Date: NSNotApplicableMarker and NSPredicate don't play nice
  • Previous by thread: Re: Hang/crash into assembly code
  • Next by thread: NSNotApplicableMarker and NSPredicate don't play nice
  • Index(es):
    • Date
    • Thread