Re: Turn on zombies in user environment?
Re: Turn on zombies in user environment?
- Subject: Re: Turn on zombies in user environment?
- From: Joar Wingfors <email@hidden>
- Date: Mon, 7 Sep 2009 00:04:06 -0700
On 6 sep 2009, at 22.48, Kyle Sluder wrote:
You'll need to make sure you have the unstripped release binary (not
a debug version) of the same app version for this backtrace to be
useful. If you don't, you will have to send the user a new binary.
For tracking down this type of issue, I would expect that having
access to the sources for a reasonably similar version of the app
would be sufficient - And if you're the developer, that shouldn't be
difficult to get at.
Also the NSZombie will prevent a crash, so the user will need to set
the appropriate breakpoint before running the program.
NSZombie doesn't prevent crashes (since Leopard). If you instruct the
user to launch the app like this:
$ NSZombieEnabled=YES /path/to/Foo.app/Contents/MacOS/Foo
...you will see something like this in the terminal where you launched
the app when you hit a zombie:
*** -[Bar baz]: message sent to deallocated instance 0x1004a8c30
Trace/BPT trap
...where "Bar" is the class of the object being messaged, and "baz" is
the message being sent. If the user isn't running the app under the
debugger, CrashReporter will pop up, and the user can copy out the
backtrace and pass it along to the developer.
If you need information about where the object was allocated, you can
get to that IF the user installs the developer tools (to get access to
gdb and malloc_history). For this scenario I'd suggest launching your
app from gdb:
$ gdb
(gdb) file /path/to/Foo.app/Contents/MacOS/Foo
(gdb) set environment NSZombieEnabled=YES
(gdb) set environment MallocStackLoggingNoCompact=1
(gdb) run
When you hit the zombie, type:
(gdb) shell malloc_history <PID> <ADDRESS>
...replacing <PID> with the pid of your app, and <ADDRESS> with the
address of the zombie. Voila: malloc_history will spit out the
backtrace to the allocation event for the zombie. Armed with this
info, you should be well on your way to tracking down the problem.
j o a r
_______________________________________________
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