Open ManoharaReddyP opened 2 months ago
Hi, thank you for reporting! Do you disable Xcode's debugger? What is the class CPPExceptionHandler? What does it do? How do you use PLCrashReporter in this particular scenario?
Hi @IlyaBausovAkvelon,
No we did't disabled Xcode debugger
CPPExceptionHandler is a mechanism typically used in cross-platform mobile applications to handle C++ exceptions that occur in native code, particularly in environments where Objective-C, Swift is used as the main application code but C++ library imported for some functionality. in this case exception being thrown from c++ using below code
(void)setCplusplusTerminateHandler:(CPPExceptionHandler)handler { CPPTerminateSetHandler(handler); }
that library being used in Objective-C project where we use PLCrashReporter to fetch crash reports and show meaning full info but seems like PLCrashreporter does't handle this exception it shown message like below
Hi @ManoharaReddyP, First of all, you should disable Xcode's debugger to make the PLCrashReporter to work with your project.
Could you please provide us with simple demo application to reproduce this issue?
Hi @IlyaBausovAkvelon,
Please find the sample library (https://github.com/RockyCognizant/CPPDemoLib) which has code that I mentioned above and import in sample project and call like below which results into crash and see if PLcrashreporter is able to capture info.
DemoLib.setCplusplusTerminateHandler { print("Hello, Exception!") }
@ManoharaReddyP thank you for demo. Could you please tell us did turning off the debugger helped?
Hi @IlyaBausovAkvelon,
This is happening even after disabling debugger. Did you get a chance to try to reproduce the issue with disabling debugger with above code?
@ManoharaReddyP , PLCrashReporter has limitations working with C++ exceptions, especially if the c++ library is linked dynamically. It may miss expected information in call stacks, depending on type of exception.
If you want to handle the C++ exception manually, you can define a handler in C++ file and get information about the exception using std::current_exception()
and std::rethrow_exception(ptr)
.
Description
We are using C++ library in our swift project which has below functions
void CPPTerminateSetHandler(CPPExceptionHandler handler) { set_terminate(handler); }
I want to understand is there anyway to block this C++ termination handler, or say, is there any way to expose the original NSException.
Currently getting below error message: Unknown Objective C Exception: instrumentation could not capture original exception. instead of displaying original
Repro Steps
Please list the steps used to reproduce your issue.
Add this as dependency to sample app and call cpp functions
DemoLib.setCplusplusTerminateHandler { print("Hello, Exception!") }
Details
Which SDK version are you using? 1.11.0
Which OS version did you experience the issue on? 15.2 but seems like it's reproduce in all version
Which CocoaPods/Carthage/Xcode version are you using? -> SPM
What device version did you see this error on? Were you using an emulator or a physical device? -> Simualtor
What language are you using?
What third party libraries are you using? No