Re: Hang/crash into assembly code
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