plcrashreporter icon indicating copy to clipboard operation
plcrashreporter copied to clipboard

Getting EXC_BAD_ACCESS (code=2) in PLCrashreport.pb-c at Line no. 127 (plcrash__crash_report__unpack)

Open jindalpatel opened this issue 2 years ago • 7 comments

Description

We are using PLCrashreporter to collect crashes. So after our app crash we reopen the app to get the crash logs but We are getting crashes in the loop in PLCrashreport.pb-c at Line no. 127 (plcrash__crash_report__unpack). We have installed PLCrashRepoter using Swift Package.

Details

PLCrashReporter - 1.10.1 iOS 15.5 Xcode 13.4 Language used - Swift We are not using any other third party libraries.

jindalpatel avatar Jun 24 '22 13:06 jindalpatel

Hi @jindalpatel, thanks for contacting us. How do you initialize the library? What signal handler type and symbolication strategy do you use?

aleksandr-dorofeev avatar Jun 25 '22 13:06 aleksandr-dorofeev

Thanks for your reply @aleksandr-dorofeev

I am initializing the library the same way mentioned here.

I simply collect the crash report data into the NSDictionary as key-value pair and then send the data to the server.

Signal handler type : PLCrashReporterSignalHandlerTypeBSD Symbolication strategy : PLCrashReporterSymbolicationStrategyNone

jindalpatel avatar Jun 25 '22 13:06 jindalpatel

Hi @jindalpatel, I cannot reproduce this issue, could you please share sample application or that corrupted file with crash report?

PS I'm going to update protobuf-c dependency where the crash happens, but not sure if it helps without local reproduction. SwiftPM can fetch the branch instead of release version, so feel free to try #241

MatkovIvan avatar Jun 28 '22 07:06 MatkovIvan

Hi @MatkovIvan Thank you for your reply, I am not able to reproduce the issue all the time, it happened once and was keep crashing the app. So I won't be able to provide the sample application which can produce the crash. Thanks for the release branch link, I will try to use that branch and will update you if I got the crash.

jindalpatel avatar Jun 29 '22 06:06 jindalpatel

Closing it for now since I've already updated the dependency where the crash happens. Feel free to reopen this issue if you have more questions or some additional info that can help with investigation. Thanks.

MatkovIvan avatar Jun 29 '22 12:06 MatkovIvan

Hi @MatkovIvan I have identified one scenario which causes an issue If I installed PLCrashreproter through SwiftPackage Manager but if added framework (1.10.2) directly it’s working fine.

Piyush23786 avatar Jul 25 '22 12:07 Piyush23786

Hi there,

@Piyush23786 thanks for reproduction sample and for confirmation that it's SwiftPM distribution issue.

But we didn't find root cause yet though. We'll let you know when it will be fixed or any other update.

MatkovIvan avatar Jul 29 '22 12:07 MatkovIvan

@MatkovIvan Any update on this?

Piyush23786 avatar Aug 17 '22 06:08 Piyush23786

@Piyush23786 No, we didn't found the root cause yet. Please use CocoaPods instead of SwiftPM for now

MatkovIvan avatar Aug 17 '22 11:08 MatkovIvan

@MatkovIvan I am not using PLCrashReporter directly. its dependencies for one of the SDK that we are using In our application. CocoaPods is not available for that SDK.

Piyush23786 avatar Aug 18 '22 12:08 Piyush23786

@jindalpatel are you using Unity in your project too?

It might be a problem with conflict of multiple PLCR versions in the same project. Unity includes PLCR copy with Unity prefix, SwiftPM uses PLCR without any prefix (by SwiftPM system limitation it cannot be changed). The list of prefixed symbols was fixed/updated some time ago - #126, but it looks like Unity uses old version where not all symbols prefixed to prevent conflicts.

@Piyush23786 It's the case for your project for sure - see a lot of warnings like Duplicate symbol '_protobuf_c_message_descriptor_get_field' in: in your build log.

So, it's not a bug in PLCR - please fix duplicating symbols by updating the libraries or by avoiding using multiple copies (with different versions) in the same app. In case of Unity + SwiftPM combination, I don't see simple solution for now. Try to open support ticket on Unity side to update PLCR there and avoid unprefixed symbols in their copy.

MatkovIvan avatar Aug 18 '22 14:08 MatkovIvan