• 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: Help with crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with crash


  • Subject: Re: Help with crash
  • From: Kurt Revis <email@hidden>
  • Date: Sun, 23 Mar 2003 13:07:32 -0800

On Sunday, March 23, 2003, at 09:18 AM, Gilbert Mackall wrote:

I could use some help in determining what caused this crash, which occurred during a window resize.

Thread 4 Crashed:
#0 0x936ff6f4 in CGClipStackRelease
#1 0x937047f8 in CGGStateResetClip
#2 0x9371b348 in CGGStateCreate
#3 0x9371da80 in CGGStackCreate
#4 0x9371e130 in CGContextCreate
#5 0x91f564a0 in __CGWindowContextCreate
#6 0x93730594 in CGWindowContextCreate
#7 0x93119c2c in -[NSWindowGraphicsContext _initWithWindowNumber:]
#8 0x93078ce4 in -[NSWindow _threadContext]
#9 0x93094c68 in -[NSWindow _postingDisabled]
#10 0x93097610 in -[NSWindow setViewsNeedDisplay:]
#11 0x9308415c in -[NSView setNeedsDisplayInRect:]
#12 0x0000682c in -[fft wfft] (fft.m:788)
#13 0x9081cd38 in forkThreadForFunction
#14 0x90020d48 in _pthread_body

First of all, this doesn't look like a CoreAudio related crash. There isn't any code on the stack which relates to CoreAudio at all. This is purely a Cocoa problem.

I assume you are doing some kind of processing in a secondary thread, and asking a view to redraw from that thread. Are you calling [someView setNeedsDisplayInRect:someRect] directly, or are you calling some other method?

I'm generally skeptical of trying to touch any UI from a non-main thread, but this page claims that what you're doing should work:
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ ProgrammingTopics/Multithreading/Tasks/appkit.html

One possible problem: Are you starting all of your other threads with pthreads, or with NSThread? In order for some Cocoa multithreading features to work correctly, you need to start at least one new NSThread in the application (at which time Cocoa sets itself up to work multithreaded). You can do this by switching from pthread_create to +[NSThread detachNewThreadSelector:toTarget:withObject:]. Or, you can create a new NSThread early in your app, which does nothing and immediately exits.

Also, where can I find information on how to decipher what these crash messages mean.

There isn't any one place which is going to tell you everything you need to know. You need to be generally familiar with the system, and what functions are in your code, and what functions aren't. You don't need to understand everything on the backtrace, just enough to get pointed in the general direction of the problem.

If you're totally unfamiliar with the concept of a backtrace, perhaps this will help:
http://developer.apple.com/techpubs/macosx/DeveloperTools/gdb/gdb/ gdb_7.html

Starting from the bottom of the stack, here's what I see happening, just based on the function names: You've started a thread using pthreads. You have a class called "fft" whose method "wfft" is being called. It has called [someView setNeedsDisplayInRect:someRect], which internally calls a bunch of private NSView methods (you can tell they're private because they start with an underscore). Furthermore, NSView is calling down to CoreGraphics (CG).

It's not worth trying to figure out the exact cause of the crash when you're 9 levels deep in private functions. Instead, look at the highest public API that you've called, and the context in which it was called, and start from there.

--
Kurt Revis
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Help with crash
      • From: Gilbert Mackall <email@hidden>
References: 
 >Help with crash (From: Gilbert Mackall <email@hidden>)

  • Prev by Date: Help with crash
  • Next by Date: Re: Help with crash
  • Previous by thread: Help with crash
  • Next by thread: Re: Help with crash
  • Index(es):
    • Date
    • Thread