Re: Help with crash
Re: Help with crash
- Subject: Re: Help with crash
- From: Gilbert Mackall <email@hidden>
- Date: Sun, 23 Mar 2003 16:23:41 -0500
Kurt,
Thanks, you comments and the pointer were very helpful.
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.
Gilbert Mackall
_______________________________________________
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.