Re: Why no crash reporter if I install some signal handler on Leopard
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=jE8z+eEk+FkcUQLn9aPKR6HDtyPJbCDbtczQ1K8iyLk=; b=EiBPCub1mEPcxDvH/fK+8qRqGQCz8qhmM5+3KWwrCbEAFPdJCs5OxABL58mrNZn0Ly09BJZ+SjAZ22oT/FG/QCBpXp3acwWQqkAgYNbgKZz1zCRyi/B/m9lqaK8Tnm78bsaiRrtWo417BJcMAfSkuAupzWcWi/orGEIze5ijfvQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=HUVc+f+hRSAX8OHPyt6QCCyi6jxWjI+8QmqiqHIK4R7a4VrwjoZ3GctCWfKqpsnIQ7vZYUZEh1Ja+X2xxrzZ4GFWNe+wJOu6A5ThZvFwAmRTY/R3xp1Yyhg+qz6OkZV44GZCNJdzLCaLASJoQruY8mkXdC+x+pKYefCzInTTrf4= On Nov 28, 2007, at 9:23 AM, Terry Lambert wrote: The following will work, but it's not ideal: ======= #include <signal.h> #include <stdio.h> void sig_abort(int sig) { printf("Application has been abort\n"); abort(); } Very true. -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/zhanglin.zhou%40gmail.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Thanks, all. I change to install an exception handler rather signal handler with api InstallExceptionHandler(), and in my exception handler, I firstly invoke some other tool to collect information, and then return -1, so the crash report dialog will be shown. But it still exist a problem: does the InstallExceptionHandler only affect the current thread? If I crash in other thread, will my exception handler be invoked? On Nov 27, 2007, at 4:36 PM, Jim Magee wrote: On Nov 27, 2007, at 5:42 PM, Terry Lambert wrote: ... It's not ideal because you can't really rethrow the abort with the same stack, you will always show as being in the trap handler (the stack for a crash report looks something like this (on a PPC): It's also not ideal because printf() is not signal-handler-safe. ;-) This email sent to zhanglin.zhou@gmail.com This email sent to site_archiver@lists.apple.com
participants (1)
-
zhanglin