sharbil / plcrashreporter

Automatically exported from code.google.com/p/plcrashreporter
Other
0 stars 0 forks source link

Crash reporter does not work in OpenGL ES iOS apps when initialized in applicationDidFinishLaunching #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an OpenGL app using the Xcode template
2. Initialize the crash reporter at the end of applicationDidFinishLaunching
3. Crash the app intentionally using something like NSAssert(NO, @"kablam");

What is the expected output? What do you see instead?
A crash report should be written.  A crash report is not written (signal 
handlers are not called)

What version of the product are you using? On what operating system?
Top of trunk; iOS 4.2

Please provide any additional information below.
See attached Xcode project.  Drop a breakpoint in sigaction and glvmDoWork and 
you'll see that sigaction gets called fist from the crash reporter code, then 
from the second glvmDoWork sometime after the application is launched, I 
believe clobbering the signal handlers that were set by the crash reporter in 
applicationDidFinishLaunching.

Ugly work-around:  As long as you initialize the crashreporter after a delay 
that is sufficient for OpenGL to have performed the *second* of its glvmDoWork 
calls, the crash reported clobbers the signal handlers that glvmDoWork sets and 
glvmDoWork does not, in my experience, reset them.

Original issue reported on code.google.com by saggau on 1 Feb 2011 at 2:19

Attachments:

GoogleCodeExporter commented 9 years ago
This seems to be LLVM's doing:

http://llvm.org/docs/doxygen/html/PrettyStackTrace_8cpp_source.html#l00117
http://llvm.org/docs/doxygen/html/Unix_2Signals_8inc_source.html#l00046

The issue specific to the simulator's GLES implementation (and until/unless 
Apple relaxes their W^X page restrictions, I don't expect to see runtime LLVM 
usage on the device).

It's fairly untoward of a library to be claiming the process' signal handlers 
-- I'm not sure what the best solution for this would be, but it probably 
warrants a bug report to Apple.

Original comment by landon.j.fuller@gmail.com on 1 Feb 2011 at 2:50

GoogleCodeExporter commented 9 years ago
I've filed rdar://9044058 (LLVM overrides the processes' signal handlers). As a 
work-around, we could also vend an API for re-registering the PLCrashReporter 
signal handler.

Original comment by landon.j.fuller@gmail.com on 23 Feb 2011 at 10:08

GoogleCodeExporter commented 9 years ago
Hi Landon.  Thanks for filing this.  I should have done so myself.  Sorry.  
I'll "me too" your bug at least.

Cheers,
Jonathan

Original comment by saggau on 24 Feb 2011 at 1:39

GoogleCodeExporter commented 9 years ago
Is there any fix for this ? I used plccrashreporter in a project compiled with 
LLVM 2.0 and crash file are not being created on sim. 

Is this the same issue ? I am not suing any OpenGL, just a regular iPad project 
on XCode4

Original comment by madha...@gmail.com on 1 Apr 2011 at 9:09

GoogleCodeExporter commented 9 years ago

Original comment by landon.j.fuller@gmail.com on 21 Sep 2011 at 8:26

GoogleCodeExporter commented 9 years ago
My bug was closed as a duplicate of rdar://7678396.

Original comment by landon.j.fuller@gmail.com on 1 Jan 2013 at 9:09