GithubHelp home page GithubHelp logo

microsoft / plcrashreporter Goto Github PK

View Code? Open in Web Editor NEW
2.8K 92.0 530.0 23.19 MB

Reliable, open-source crash reporting for iOS, macOS and tvOS

License: Other

C 23.75% Makefile 0.19% Shell 0.52% Assembly 13.84% Objective-C 35.87% C++ 13.75% Objective-C++ 11.92% Rich Text Format 0.02% Ruby 0.06% Swift 0.09%
crash-reporting ios macos

plcrashreporter's Introduction

CocoaPods Carthage compatible SwiftPM compatible

PLCrashReporter

PLCrashReporter is a reliable open source library that provides an in-process live crash reporting framework for use on iOS, macOS and tvOS. The library detects crashes and generates reports to help your investigation and troubleshooting with the information of application, system, process, thread, etc. as well as stack traces.

The easiest way to use PLCrashReporter is by using AppCenter. However, if you want to use PLCrashReporter directly, grab the latest release at releases page.

Features

  • Uses only supported and public APIs/ABIs for crash reporting.
  • The most accurate stack unwinding available, using DWARF and Apple Compact Unwind frame data.
  • First released in 2008, and used in hundreds of thousands of apps. PLCrashReporter has seen a tremendous amount of user testing.
  • Does not interfere with debugging in lldb/gdb
  • Backtraces for all active threads are provided.
  • Provides full register state for the crashed thread.

Prerequisites

  • Xcode 11 or above.
  • Minimum supported platforms: iOS 11, macOS 10.9, tvOS 11, Mac Catalyst 13.0.

Decoding Crash Reports

Crash reports are output as protobuf-encoded messages, and may be decoded using the CrashReporter library or any Google Protocol Buffers decoder.

In addition to the in-library decoding support, you may use the included plcrashutil binary to convert crash reports to apple's standard iPhone text format:

plcrashutil convert --format=iphone example_report.plcrash

You can use atos command-line tool to symbolicate the output. For more information about this tool, see Adding Identifiable Symbol Names to a Crash Report. Future library releases may include built-in re-usable formatters, for outputting alternative formats directly from the phone.

Adding PLCrashReporter to your project

PLCrashReporter can be added to your app via CocoaPods, Carthage, Swift Package Manager, or by manually adding the binaries to your project.

Integration via Cocoapods

  1. Add the following line to your Podfile:
    pod 'PLCrashReporter'
  2. Run pod install to install your newly defined pod and open the project's .xcworkspace.

Integration via Swift Package Manager

  1. From the Xcode menu, click File > Swift Packages > Add Package Dependency.
  2. In the dialog that appears, enter the repository URL: https://github.com/microsoft/plcrashreporter.git.
  3. In Version, select Up to Next Major and take the default option.

Integration via Carthage

  1. Add the following line to your Cartfile:
    github "microsoft/plcrashreporter"
  2. Run carthage update --use-xcframeworks to fetch dependencies.
  3. In Xcode, open your application target's General settings tab. Drag and drop CrashReporter.xcframework from the Carthage/Build folder into the Frameworks, Libraries and Embedded Content section. For iOS and tvOS, set Embed to Do not embed. For macoS, set Embed to Embed and Sign.

NOTE: Carthage integration doesn't build the dependency correctly in Xcode 12 with flag "--no-use-binaries" or from a specific branch. To make it work, refer to this instruction.

Integration by copying the binaries into your project

  1. Download the PLCrashReporter frameworks provided as a zip file.
  2. Unzip the file and you'll see a folder called PLCrashReporter that contains subfolders for all supported platforms.
  3. Add PLCrashReporter to the project in Xcode:
    • Make sure the Project Navigator is visible (⌘+1).
    • Now drag & drop PLCrashReporter.framework (or PLCrashReporter.xcframework) from the Finder into Xcode's Project Navigator.
    • A dialog will appear, make sure your app target is checked and click Finish.

    NOTE: PLCrashReporter xcframework contains static binaries for iOS and tvOS, and dynamic binaries for macOS. When adding the framework to your project make sure that in Frameworks, Libraries and Embedded Content section Embed is selected to Do not embed for iOS and tvOS and Embed and Sign for macOS. PLCrashReporter-Static-{version}.zip is an exception - it contains static frameworks for all platforms.

Example

The following example shows a way how to initialize crash reporter. Please note that enabling in-process crash reporting will conflict with any attached debuggers so make sure the debugger isn't attached when you crash the app.

Objective-c

@import CrashReporter;

...

// Uncomment and implement isDebuggerAttached to safely run this code with a debugger.
// See: https://github.com/microsoft/plcrashreporter/blob/2dd862ce049e6f43feb355308dfc710f3af54c4d/Source/Crash%20Demo/main.m#L96
// if (![self isDebuggerAttached]) {

// It is strongly recommended that local symbolication only be enabled for non-release builds.
// Use PLCrashReporterSymbolicationStrategyNone for release versions.
PLCrashReporterConfig *config = [[PLCrashReporterConfig alloc] initWithSignalHandlerType: PLCrashReporterSignalHandlerTypeMach
                                                                   symbolicationStrategy: PLCrashReporterSymbolicationStrategyAll];
PLCrashReporter *crashReporter = [[PLCrashReporter alloc] initWithConfiguration: config];

// Enable the Crash Reporter.
NSError *error;
if (![crashReporter enableCrashReporterAndReturnError: &error]) {
    NSLog(@"Warning: Could not enable crash reporter: %@", error);
}
// }

Checking collected crash report can be done in the following way:

if ([crashReporter hasPendingCrashReport]) {
    NSError *error;

    // Try loading the crash report.
    NSData *data = [crashReporter loadPendingCrashReportDataAndReturnError: &error];
    if (data == nil) {
        NSLog(@"Failed to load crash report data: %@", error);
        return;
    }

    // Retrieving crash reporter data.
    PLCrashReport *report = [[PLCrashReport alloc] initWithData: data error: &error];
    if (report == nil) {
        NSLog(@"Failed to parse crash report: %@", error);
        return;
    }

    // We could send the report from here, but we'll just print out some debugging info instead.
    NSString *text = [PLCrashReportTextFormatter stringValueForCrashReport: report withTextFormat: PLCrashReportTextFormatiOS];
    NSLog(@"%@", text);

    // Purge the report.
    [crashReporter purgePendingCrashReport];
}

Swift

import CrashReporter

...
// Uncomment and implement isDebuggerAttached to safely run this code with a debugger.
// See: https://github.com/microsoft/plcrashreporter/blob/2dd862ce049e6f43feb355308dfc710f3af54c4d/Source/Crash%20Demo/main.m#L96
// if (!isDebuggerAttached()) {

  // It is strongly recommended that local symbolication only be enabled for non-release builds.
  // Use [] for release versions.
  let config = PLCrashReporterConfig(signalHandlerType: .mach, symbolicationStrategy: .all)
  guard let crashReporter = PLCrashReporter(configuration: config) else {
    print("Could not create an instance of PLCrashReporter")
    return
  }

  // Enable the Crash Reporter.
  do {
    try crashReporter.enableAndReturnError()
  } catch let error {
    print("Warning: Could not enable crash reporter: \(error)")
  }
// }

Checking collected crash report can be done in the following way:

  // Try loading the crash report.
  if crashReporter.hasPendingCrashReport() {
    do {
      let data = try crashReporter.loadPendingCrashReportDataAndReturnError()

      // Retrieving crash reporter data.
      let report = try PLCrashReport(data: data)

      // We could send the report from here, but we'll just print out some debugging info instead.
      if let text = PLCrashReportTextFormatter.stringValue(for: report, with: PLCrashReportTextFormatiOS) { 
        print(text)
      } else {
        print("CrashReporter: can't convert report to text")
      }
    } catch let error {
      print("CrashReporter failed to load and parse with error: \(error)")
    }
  }

  // Purge the report.
  crashReporter.purgePendingCrashReport()

Building

Prerequisites

  • A Mac running macOS compliant with Xcode requirements.
  • Xcode 11 or above.

Also, next optional tools are used to build additional resources:

Building

  • Open a new window for your Terminal.

  • Go to PLCrashReporter's root folder and run

    xcodebuild -configuration Release -target 'CrashReporter'

    to create binaries for all platforms.

Contributing

We are looking forward to your contributions via pull requests.

To contribute to PLCrashReporter, you need the tools mentioned above to build PLCrashReporter for all architectures and protobuf-c to convert Protocol Buffer .proto files to C descriptor code.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

plcrashreporter's People

Contributors

adubovkin avatar anatolypristensky avatar biluncloud avatar dmitriykirakosyan avatar erkanyildiz avatar grigorye avatar hazat avatar iamclement avatar ilyashumihin avatar jaeklim avatar jakob avatar jamminroot avatar jasminlapalme avatar jaysoffian avatar john7doe avatar kimwanki avatar landonf avatar lumaxis avatar matkovivan avatar mikhailsuendukov avatar nachobonafonte avatar nsc avatar patniko avatar pepas-everly avatar richardgroves avatar shadyabarada avatar sirg3 avatar sumanc avatar thewulf7 avatar youbing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plcrashreporter's Issues

EXC_CRASH (SIGABRT) when plcrash::PL::async::dwarf_cfa_state_iterator crash

Date/Time:           2019-10-22 10:41:09.7985 +0800
Launch Time:         2019-10-22 10:41:08.5264 +0800
OS Version:          iPhone OS 13.1.3 (17A878)
Release Type:        User
Baseband Version:    2.01.08
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Last Exception Backtrace:
0   CoreFoundation                	0x1ad039c30 __exceptionPreprocess + 224
1   libobjc.A.dylib               	0x1acd540c8 objc_exception_throw + 59
2   CoreFoundation                	0x1acf3675c +[NSException raise:format:arguments:] + 99
3   Foundation                    	0x1ad377960 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 131
4   HeJiZiXun                     	0x1052382d0 plcrash::PL::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next+ 7045840 (unsigned int*, plcrash::PL::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 539679
5   HeJiZiXun                     	0x105240bfc plcrash::PL::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next+ 7080956 (unsigned int*, plcrash::PL::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 574795
6   HeJiZiXun                     	0x10523d92c plcrash::PL::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next+ 7067948 (unsigned int*, plcrash::PL::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 561787
7   HeJiZiXun                     	0x10523d24c plcrash::PL::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next+ 7066188 (unsigned int*, plcrash::PL::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 560027
8   libdispatch.dylib             	0x1acce100c _dispatch_client_callout + 19
9   libdispatch.dylib             	0x1acce26f4 _dispatch_once_callout + 31
10  HeJiZiXun                     	0x10523d0d4 plcrash::PL::async::dwarf_cfa_state_iterator<unsigned long long, long long>::next+ 7065812 (unsigned int*, plcrash::PL::async::plcrash_dwarf_cfa_reg_rule_t*, unsigned long long*) + 559651
11  HeJiZiXun                     	0x104f4689c 0x104b80000 + 3958940
12  HeJiZiXun                     	0x104f4536c 0x104b80000 + 3953516
13  UIKitCore                     	0x1b10c5d80 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 343
14  UIKitCore                     	0x1b10c7b90 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5111
15  UIKitCore                     	0x1b10cd568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1311
16  UIKitCore                     	0x1b0875710 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 151
17  UIKitCore                     	0x1b0d217e8 _UIScenePerformActionsWithLifecycleActionMask + 111
18  UIKitCore                     	0x1b0876248 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 211
19  UIKitCore                     	0x1b0875d30 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 487
20  UIKitCore                     	0x1b0876064 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 751
21  UIKitCore                     	0x1b08758e8 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 339
22  UIKitCore                     	0x1b087a098 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 195
23  UIKitCore                     	0x1b0d3b214 ___UISceneSettingsDiffActionPerformChangesWithTransitionContext_block_invoke + 27
24  UIKitCore                     	0x1b0c4ee90 +[BSAnimationSettings+ 5963408 (UIKit) tryAnimatingWithSettings:actions:completion:] + 867
25  UIKitCore                     	0x1b0d3b1cc _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 259
26  UIKitCore                     	0x1b0879db0 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 151
27  UIKitCore                     	0x1b0d3b0b4 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 107
28  UIKitCore                     	0x1b0879c0c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 391
29  UIKitCore                     	0x1b06e5630 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 639
30  UIKitCore                     	0x1b06e40f4 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 255
31  UIKitCore                     	0x1b06e5360 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 235
32  UIKitCore                     	0x1b10cb91c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 563
33  UIKitCore                     	0x1b0c70d7c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 375
34  FrontBoardServices            	0x1b21a3014 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 451
35  FrontBoardServices            	0x1b21c9bd0 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.168 + 115
36  FrontBoardServices            	0x1b21ae0f8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 239
37  FrontBoardServices            	0x1b21c9864 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 343
38  libdispatch.dylib             	0x1acce100c _dispatch_client_callout + 19
39  libdispatch.dylib             	0x1acce3d50 _dispatch_block_invoke_direct + 263
40  FrontBoardServices            	0x1b21f0384 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 47
41  FrontBoardServices            	0x1b21f0030 -[FBSSerialQueue _queue_performNextIfPossible] + 431
42  FrontBoardServices            	0x1b21f059c -[FBSSerialQueue _performNextFromRunLoopSource] + 31
43  CoreFoundation                	0x1acfb5260 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
44  CoreFoundation                	0x1acfb51b4 __CFRunLoopDoSource0 + 83
45  CoreFoundation                	0x1acfb4920 __CFRunLoopDoSources0 + 183
46  CoreFoundation                	0x1acfaf7ec __CFRunLoopRun + 1067
47  CoreFoundation                	0x1acfaf098 CFRunLoopRunSpecific + 479
48  GraphicsServices              	0x1b7119534 GSEventRunModal + 107
49  UIKitCore                     	0x1b10cf7ac UIApplicationMain + 1939
50  HeJiZiXun                     	0x104f208b0 0x104b80000 + 3803312
51  libdyld.dylib                 	0x1ace2ef30 start + 3

Support Apple Silicon (macOS arm64) and Xcode 12

When compiling under Xcode 12 with macos arm64 target, an error is raised in plcrash_async_cfe_entry_return_address_register due to what appears to be an errant boolean expression using a constant.

Docs indicate that the entry types PLCRASH_ASYNC_CFE_ENTRY_TYPE_FRAMELESS_IMMD and PLCRASH_ASYNC_CFE_ENTRY_TYPE_FRAMELESS_INDIRECT should be supported, but the boolean expression appears to || in the PLCRASH_ASYNC_CFE_ENTRY_TYPE_FRAMELESS_INDIRECT.

It looks like the fix is to add (entry->type ==) around the PLCRASH_ASYNC_CFE_ENTRY_TYPE_FRAMELESS_INDIRECT, which allows it to compile and appears consistent with the documentation of the function.

SIGSEGV / SEGV_MAPERR when calling -generateLiveReport

I sometimes get a crash when calling [PLCrashReporter generateLiveReport]

The crash seems to happen in this line:

pl_vm_address_t methodNamePtr = (image->m64

I tried debugging, and it looks like cursor points to unmapped memory.

I'm on macOS 10.15.7, my app is built using XCode 12.2, and I'm using PLCrashReporter 1.8.1

The crash doesn't always happen. I'm trying to find a minimal test case. I'll follow up on this issue once I know more.

arm64e stack trace displays ???

I integrated the latest CrashReporter.framework for iOS available from release 1.2.3-rc1, but the stack trace from an arm64e (iPhone XS) device still display ??? for library names and the addresses are 0. I thought this fork supports arm64e devices. Am I missing something here? Thanks.

Undefined symbol "___gxx_personality_v0" without explicit including C++ library

I integrated release 1.6 via cocoapods in my project.
When I try to run my app on an iPad Air 2, the compile does not work.

I'm getting the following error from the linker:
Undefined symbols for architecture arm64: "___gxx_personality_v0", referenced from: _plcrash_async_objc_isa_pointer in CrashReporter(PLCrashAsyncObjCSection.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Using release 1.5.1 works.

Add via SPM

Description

I'm trying to add the library via SPM but failing to do so.

Repro Steps

I have a repro where I:

  1. Created a new project with a plain `swift package init --type=executable (here)
  2. Tried to add the library here

Errors as:

'plcrashreporter-spm-repro' /Users/bruno/temp/plcrashreporter-spm-repro: error: product 'PLCrashReporter' not found. It is required by target 'plcrashreporter-spm-repro'.
warning: dependency 'PLCrashReporter' is not used by any target

Details

macOS 10.15.7

Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
Target: x86_64-apple-darwin19.6.0

Am I adding this wrong?

Can this Crash framework coexist with other third-party Crash frameworks? Examples include Bugly and Umeng

  1. Which SDK version are you using?
    1.8.1
  2. Which OS version did you experience the issue on?
    Can this Crash framework coexist with other third-party Crash frameworks? Examples include Bugly and Umeng
  3. Which CocoaPods/Carthage/Xcode version are you using?
  4. What device version did you see this error on? Were you using an emulator or a physical device?
  5. What language are you using?
    • Objective C
  6. What third party libraries are you using?
    bugly and Umeng framework

PLCrashReporter maintainership moving to Microsoft

Hi everyone!

I'm very pleased to let everyone know that my team at Microsoft has worked with @chrispcampbell and Plausible Labs and agreed to transfer this repo to the microsoft organization on GitHub and we are taking over maintainership of the project going forward. More details will follow in blogposts that we're going to publish some time later today and that I'll of course add here, too. 😊

Having worked with PLCrashReporter ever since I started at HockeyApp in 2014, I'm really super happy that we found a way to keep this project healthy and am super looking forward to what's to come 🎉

If you have any questions, please feel free to ask them here, @derpixeldan and I are happy to answer.

Timestamp value is nil in SystemInfo

Hi,

I am using PLCrashreporter in my project. I want to fetch the timestamp when the report was generated by using report.systemInfo.timestamp, but this comes as nil.
It is written in the document that it may be nil if the date is unavailable.
Any help would be helpful in figuring out the reason for it to be coming as nil and what workaround is recommended to resolve it.

Platform - IOS Simulator

Unwinding fails in a swift classes on arm64e only

I created a simple swift class to simulate a crash:

class SwiftViewController: UIViewController {

    @IBOutlet weak var myButton: UIButton!

    override func viewDidLoad() {
        super.viewDidLoad()
        print([1, 2, 3][4])
    }
}

I just noticed that this crash on arm64e devices have only the first frame in each thread, except frames which have the app frames at the top it unwinds successfully through the apps' frames until the first non-app frame (iOS SDK frame) then fails to unwind again.

I dug a little deeper in the logs, it says that it could not find the loaded image for the current pc , however the images in which unwinding fails are loaded.

How to conditionally enable/disable PLCrashreporter?

Hi,

I am trying out PLCrashreporter in one of my app. I want to control the crash collection based on the user's server configuration.

Suppose the user has some server flag say ENABLE_CRASH_COLLECTION.
If this flag is set to false, I want to disable/stop the PLCrashreporter from collecting crashes in runtime.

Currently, I am fetching the server flag value, but I could not find any api to stop the crashreporter, while app is in running state.

Any help or pointer would really be helpful. I am using latest release build of PLCrashreporter

Thanks,
Pravin

api for setting the crash path

Is your feature request related to a problem? Please describe.
Our app has a sub-process. When the app starts, it will start the sub-process which is a console app. The main app runs in sandbox on MacOS and can find the sandbox path, but the sub-process can not find the sandbox path correctly, so PLCrashReporter cann't write the crash info because of permission issue.

Describe the solution you'd like

  • (instancetype) initWithConfiguration: (PLCrashReporterConfig ) configuration basePath:(NSString) basePath {
    return [self initWithBundle: [NSBundle mainBundle] basePath:basePath configuration: configuration];
    }

  • (id) initWithBundle: (NSBundle ) bundle basePath:(NSString)basePath configuration: (PLCrashReporterConfig *) configuration {
    NSString *bundleIdentifier = [bundle bundleIdentifier];
    NSString *bundleVersion = [[bundle infoDictionary] objectForKey: (NSString *) kCFBundleVersionKey];
    NSString *bundleMarketingVersion = [[bundle infoDictionary] objectForKey: @"CFBundleShortVersionString"];

    /* Verify that the identifier is available */
    if (bundleIdentifier == nil) {
    const char *progname = getprogname();
    if (progname == NULL) {
    [NSException raise: PLCrashReporterException format: @"Can not determine process identifier or process name"];
    return nil;
    }

      PLCR_LOG("Warning -- bundle identifier, using process name %s", progname);
      bundleIdentifier = [NSString stringWithUTF8String: progname];
    

    }

    /* Verify that the version is available */
    if (bundleVersion == nil) {
    PLCR_LOG("Warning -- bundle version unavailable");
    bundleVersion = @"";
    }

    return [self initWithApplicationIdentifier: bundleIdentifier appVersion: bundleVersion appMarketingVersion:bundleMarketingVersion basePath:basePath configuration: configuration];
    }

  • (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier appVersion: (NSString *) applicationVersion appMarketingVersion: (NSString ) applicationMarketingVersion basePath:(NSString)basePath configuration: (PLCrashReporterConfig ) configuration {
    /
    Initialize our superclass */
    if ((self = [super init]) == nil)
    return nil;

    /* Save the configuration */
    _config = configuration;
    _applicationIdentifier = applicationIdentifier;
    _applicationVersion = applicationVersion;
    _applicationMarketingVersion = applicationMarketingVersion;

    /* No occurances of '/' should ever be in a bundle ID, but just to be safe, we escape them */
    NSString *appIdPath = [applicationIdentifier stringByReplacingOccurrencesOfString: @"/" withString: @"_"];

    //NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    //NSString *cacheDir = [paths objectAtIndex: 0];
    _crashReportDirectory = [[basePath stringByAppendingPathComponent: PLCRASH_CACHE_DIR] stringByAppendingPathComponent: appIdPath];

    return self;
    }

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context about the feature request here.

invalid cert on plcrashreporter.org (affects CocoaPods)

Affects the CocoaPods spec for v1.2 (already published). Results in error:

Installing PLCrashReporter (1.2.0)

[!] Error installing PLCrashReporter
[!] /usr/bin/curl -f -L -o /var/folders/9x/x_w24rtx1lnc_bf04f4773t80000gn/T/d20200221-38132-1wyl9ha/file.zip https://www.plcrashreporter.org/static/downloads/PLCrashReporter-1.2.zip --create-dirs --netrc-optional --retry 2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL: no alternative certificate subject name matches target host name 'www.plcrashreporter.org'
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Xcode 12 SPM `IPHONEOS_DEPLOYMENT_TARGET` warning

Description

When using Xcode 12 GM there is a warning:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.

Repro Steps

  1. Download Xcode 12
  2. Add as a SPM dependency
  3. Build

Details

  1. Which SDK version are you using?
    Xcode Version 12.0 (12A7208)

  2. Which OS version did you experience the issue on?
    iOS 14

  3. Which CocoaPods/Carthage/Xcode version are you using?
    Xcode Version 12.0 (12A7208) with SPM

  4. What device version did you see this error on? Were you using an emulator or a physical device?
    Xcode

  5. What language are you using?

    • Objective C
    • Swift
  6. What third party libraries are you using?
    AppCenter

According to this thread the problem is that this line is overriding Xcode settings forcing IPHONEOS_DEPLOYMENT_TARGET to an unsupported SDK version by Xcode 12.

The solution on the thread was remove the platforms section, because they support all platforms/versions so this might not work in this case.

Cannot build PLCReporter on macOS 10.15

Hi all 👋

I've been trying to rebuild this on macOS 10.15 but there's an issues that is related to macOS 10.15 and some issues that are not.

Specific to macOS 10.15:

  • protoc-c included with the repo doesn't work anymore because it's 32 bit

My fix: I had to reinstall it with brew and modify many other things

Not specific to macOS 10.15:

  • The product directory and name for both the CrashReporter-iOS-Device and CrashRepoter-iOS-Simulator is the (inherited from CrashReporter-iOS) because it's based in a build setting called EFFECTIVE_PLATFORM_NAME and the name set there iphoneos is not the same as the names expected from lipo which are iPhoneOS and iPhoneSimulator

My fix: Added EFFECTIVE_PLATFORM_NAME in CrashReporter-iOS-Device and CrashReporter-iOS-Simulator with values iPhoneOS and iPhoneSimulator respectively.

  • When Disk Image is built for simulator CrashReporter-iOS-Device build for "i386 and x86_64" only is the same as CrashReporter-iOS-Simulator which cause lipo to throw and error because it tries to combine 2 binaries with the same architecture (the opposite happens when trying to build for device)

My fix: Removed CrashReporter-iOS-Device from the dependencies of Disk Image and built it alone to device then built Disk Image for Simulator.
This is not really a fix and the common practice (IMHO) for building fat binary is that the aggregate target itself build with xcodebuild both targets for simulator and for device then combine them not depend on Xcode to build them.

PLCrashReporter breaks background app relaunch on iOS 14

Description

Enabling the PLCrashReporter framework causes the app to no longer be able to relaunch in the background on iOS 14

Repro Steps

Please list the steps used to reproduce your issue.

  1. Have an app with the legacy-voip entitlement
  2. Use PLCrashReporter in the app (directly or transitively through AppCenter)
  3. Start the app
  4. Crash the App

Expected: When the app crashes, it is relaunched in the background without user intervention

Actual: The app does not relaunch in the background

Details

  1. Which SDK version are you using?
    1.7.2
  2. Which OS version did you experience the issue on?
    iOS 14.0+
  3. Which CocoaPods/Carthage/Xcode version are you using?
    CocoaPods 1.9.1
    Xcode 12.GM.seed/Xcode 12.2 Beta/Xcode 11.7
  4. What device version did you see this error on? Were you using an emulator or a physical device?
    Physical iOS devices (model doesn't seem to be a factor)
  5. What language are you using?
    • Objective C
    • Swift
  6. What third party libraries are you using?
  • CocoaLumberjack
  • KissXML
  • XMPPFramework
  • RealmSwift
  • PLCrashReporter

No dynamic framework in release assets?

On version 1.5.1 release assets I see these two zips:

PLCrashReporter-1.5.1.zip
PLCrashReporter-Static-1.5.1.zip

One of them has -Static stated explicitly.
So, it gives me the impression that the other one is dynamic.

But when I checked the contents, I noticed that it is not:

mbp: iOS Framework/CrashReporter.framework$ file CrashReporter 
CrashReporter: Mach-O universal binary with 6 architectures: [arm_v7:current ar archive] [arm_v7s] [i386] [x86_64] [arm64] [arm64e]
CrashReporter (for architecture armv7):	current ar archive
CrashReporter (for architecture armv7s):	current ar archive
CrashReporter (for architecture i386):	current ar archive
CrashReporter (for architecture x86_64):	current ar archive
CrashReporter (for architecture arm64):	current ar archive
CrashReporter (for architecture arm64e):	current ar archive

Is this intentional?

arm64e Address broken for certain crashes

Repro case:
https://github.com/hazat/CrashProbe
the latest commit

Run the app on an arm64e device (without debugger)
Click on the first entry and crash Crash with _pthread_list_lock_held

Run the app in debugger and look at the output:

frame 1 & 2 have broken memory addresses space:

0   libsystem_platform.dylib            0x00000001b7496624 _platform_memmove + 308
1   ???                                 0x552d8101b7499f3c 0x0 + 0
2   ???                                 0x9b0ea28102c92d34 0x0 + 0
3   CrashProbeiOS                       0x0000000102c1a48c -[CRLDetailViewController doCrash] + 48

Full snippet

2020-02-12 15:21:18.134584+0100 CrashProbeiOS[5064:3927992] Incident Identifier: EB99C189-88DD-4BC5-8D92-F9580F463AEB
CrashReporter Key:   TODO
Hardware Model:      iPhone12,3
Process:         CrashProbeiOS [5060]
Path:            /private/var/containers/Bundle/Application/C1C8A4AD-D615-49C5-AD93-BBA09ABA08A1/CrashProbeiOS.app/CrashProbeiOS
Identifier:      net.hockeyapp.CrashProbeiOS
Version:         1.0 (1)
Code Type:       ARM-64
Parent Process:  ??? [1]

Date/Time:       2020-02-12 14:21:14 +0000
OS Version:      iPhone OS 13.3.1 (17D50)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_MAPERR at 0x1
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_platform.dylib            0x00000001b7496624 _platform_memmove + 308
1   ???                                 0x552d8101b7499f3c 0x0 + 0
2   ???                                 0x9b0ea28102c92d34 0x0 + 0
3   CrashProbeiOS                       0x0000000102c1a48c -[CRLDetailViewController doCrash] + 48
4   libobjc.A.dylib                     0x00000001b74a4cc8 <redacted> + 76

How to build a standalone protoc-c, like the previous v1.2 ?

I know the best way right now is to install protobuf-c with brew, but here I have to build it myself. I have tried to build according to protobuf-c's documentation, but I just got a protoc-gen-c.

Then I renamed it to protoc-c and dragged it into the project to execute the command --c_out="${DERIVED_FILES_DIR}/${CURRENT_ARCH}" "${INPUT_FILE_NAME}", which can also be executed. But it seems to depend on other libraries in my computer, it can't run independently on another computer.

Fixed crash with nil exception - new release?

Hey!

First of all thanks very much for the hard work maintaining this awesome tool!

We have started to experience crashes in production with the following issue:
99baa22

I am just wondering, could we expect the next release anytime soon?

Best,
Daniel

Possibility to add user info to crash information?

Describe the solution you'd like
I would like to have the possibility to add some custom information to the crash reporter so it can be saved in the crash report and recovered later as a property of PLCrashReport.

Describe alternatives you've considered
I thought about using crash callback with an arbitrary context but it has the problem that cannot be modified once crash reporter is enabled and it would need to save that information in a separate file needing to handle separately.

Additional context
The idea is to keep extra information about what was happening in the app when the crash happened.

SSL error installing PLCrashReporter (1.2.0) on cocoapods

pods version 1.7.3

Message:

Installing PLCrashReporter (1.2.0)

[!] Error installing PLCrashReporter
[!] /usr/bin/curl -f -L -o /var/folders/j_/nv5vhkp10pd74bj8zbrm8v0m0000gn/T/d20200117-45921-9e18yv/file.zip https://www.plcrashreporter.org/static/downloads/PLCrashReporter-1.2.zip --create-dirs --netrc-optional --retry 2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (60) SSL: no alternative certificate subject name matches target host name 'www.plcrashreporter.org'
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Looks like https://www.plcrashreporter.org has SSL cert issues.

Why doesn't PLCrashReporter recognize a crash with code - 0x8badf00d

I have PLCrashReporter integrated into my app and I have some crashes reported because of the watch dog timeout. But PLCrashReporter does not seem to recognize this as a crash and I dont see a report being generated for this.

Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, process-exit watchdog transgression: application<>:38090 exhausted real (wall clock) time allowance of 5.00 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: process-exit | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 2.570 (user 2.570, system 0.000), 9% CPU", | "Elapsed applicatn CPU time (seconds): 0.124, 0% CPU" | )
Triggered by Thread: 0

plcrashreporter1.7 crash on iOS9

Description

Please describe the issue you are facing using the SDK.

Repro Steps

Please list the steps used to reproduce your issue.

  1. init the plcrashrepoter then will be crash on plcrash::PL_::async::async_list<plcrash_async_image*>::nasync_append
??? 0x000000016fd9b460 + 0
1 ??? 0x0000000180dcac8a + 0
2 ??? 0x000000019aa13b60 + 0
3 libdyld.dylib dyld_stub_binder + 60
4 MyApp plcrash::PL_::async::async_list<plcrash_async_image*>::nasync_append(plcrash_async_image*) + 24
5 MyApp image_add_callback + 52
6 ??? 0x0000000180dcac8a + 0
7 libdyld.dylib _dyld_register_func_for_add_image + 76
8 MyApp +[PLCrashReporter initialize] + 108

Details

  1. Which SDK version are you using?
    1.7

  2. Which OS version did you experience the issue on?
    iOS9

  3. Which CocoaPods/Carthage/Xcode version are you using?
    1.8.4

  4. What device version did you see this error on? Were you using an emulator or a physical device?
    iphone6s

  5. What language are you using?
    Objective C

  6. What third party libraries are you using?

PLCrashReporter v1.8.1 crashlogs are not getting generated

Hey team,

I have integrated PLCrashReporterv1.8.1 to the project and simulated some crashes. But the reporter always says no pending reports even after the crashes. I added the framework from the PLCrashReporter-1.8.1.zip-> iOS framework. Could anyone please guide me the framework integration if I am missing anything from frameworks integration?

Can I post crash log to Server on app Crash? I want post app's crash log to server while app crashing instead of launching app again?

Description

Can I post crash log to Server on app Crash? I want post app's crash log to server while app crashing instead of launching app again?

Repro Steps

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let config = PLCrashReporterConfig.init(signalHandlerType: .BSD, symbolicationStrategy: .all, shouldRegisterUncaughtExceptionHandler: true)
        let reporter = PLCrashReporter.init(configuration: config)
        var cb:PLCrashReporterCallbacks = .init(version: 0,
                                                context: UnsafeMutableRawPointer.init(bitPattern: 0xABABABAB),
                                                handleSignal:  { (info,  uap, context) in
                                                    print("enter call back!!!")
                                                    print(info?.pointee,uap?.pointee,context)
                                                   
                                                     try? reporter?.loadPendingCrashReportDataAndReturnError()//Here I can't get reporter: "A C function pointer cannot be formed from a closure that captures context"
                                                    
                                                    
                                                })
        
        
        
        
        reporter?.setCrash(&cb)
        do {
            try  reporter?.enableAndReturnError()
        } catch let error {
            
            print("failed:",error)
        }
       
        return true
    }

Details

  1. Which SDK version are you using?
    1.7.1
  2. Which OS version did you experience the issue on?
    iOS 14.0 beta
  3. Which CocoaPods/Carthage/Xcode version are you using?
    12.beta.3
  4. What device version did you see this error on? Were you using an emulator or a physical device?
    iPhone 6s
  5. What language are you using?
    • [ X] Objective C
    • [ O] Swift
  6. What third party libraries are you using?
    PODS:
  • Alamofire (5.2.2)
  • netfox (1.19.0)
  • PLCrashReporter (1.7.1)

Duplicate symbols in applications with -all_load flag

duplicate symbol '_PLCrashReporterException' in:
Pods/PLCrashReporter/iOS Framework/CrashReporter.framework/CrashReporter(CrashReporter-x86_64-master.o)
Pods/PLCrashReporter/iOS Framework/CrashReporter.framework/CrashReporter(CrashReporter.o)
duplicate symbol '_PLCrashReporterErrorDomain' in:
Pods/PLCrashReporter/iOS Framework/CrashReporter.framework/CrashReporter(CrashReporter-x86_64-master.o)
Pods/PLCrashReporter/iOS Framework/CrashReporter.framework/CrashReporter(CrashReporter.o)
ld: 2 duplicate symbols for architecture x86_64

Issues when trying to use in iOS with Cocoapods in a dynamic framework

Is your feature request related to a problem? Please describe.
I would like to use PLCrashReporter as a dependency of another dynamic library say A when using Cocoapods in iOS. But as the PLCrashReporter framework is distributed as a vendored static framework, it forces to make A framework static or fails when running pod install in the app that references framework A. Fails with a message like: target has transitive dependencies that include statically linked binaries

Describe the solution you'd like
I would like to have a way to use PLCrashReporter with Cocoapods with iOS or tvOS as a dynamic framework (as macOS version is doing)

Describe alternatives you've considered
Don't know if that can be done using a subspec and a different vendored build, or a different podspec is needed for that.

Crash in PLCrashAsyncThread_arm.c with ${STANDARD_ARCHITECTURE} + arm64e

Description

Adding arm64e to the Architecture build setting causes crash reporter to hang in plcrash_async_thread_state_get_reg_64() trying to read the FP reg.

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1029df494)
  * frame #0: 0x00000001029df494 MicrosoftPLCrashTests`plcrash_async_thread_state_get_reg_64(ts=0x0000000114222c58, regnum=1) at PLCrashAsyncThread_arm.c:297:39
    frame #1: 0x00000001029df02c MicrosoftPLCrashTests`plcrash_async_thread_state_get_reg(ts=0x0000000114222c58, regnum=1) at PLCrashAsyncThread_arm.c:311:16
    frame #2: 0x00000001029e6b78 MicrosoftPLCrashTests`plcrash_async_cfe_entry_apply(task=259, function_address=4338743740, thread_state=0x0000000114222c58, entry=0x00000001142220f0, new_thread_state=0x0000000114222690) at PLCrashAsyncCompactUnwindEncoding.c:1083:33
    frame #3: 0x00000001029e1bac MicrosoftPLCrashTests`plframe_cursor_read_compact_unwind(task=259, image_list=0x0000000102a2ada0, current_frame=0x0000000114222c58, previous_frame=0x0000000114222b28, next_frame=0x0000000114222690) at PLCrashFrameCompactUnwind.c:136:16
    frame #4: 0x00000001029c46f4 MicrosoftPLCrashTests`plframe_cursor_next_with_readers(cursor=0x0000000114222b10, readers=0x00000001142228a0, reader_count=3) at PLCrashFrameWalker.c:151:16
    frame #5: 0x00000001029c4970 MicrosoftPLCrashTests`plframe_cursor_next(cursor=0x0000000114222b10) at PLCrashFrameWalker.c:199:12
    frame #6: 0x00000001029c72c4 MicrosoftPLCrashTests`plcrash_writer_write_thread(file=0x0000000000000000, writer=0x0000000102a2adc8, task=259, thread=1031, thread_number=0, thread_ctx=0x00000001142238c0, image_list=0x0000000102a2ada0, findContext=0x00000001142230b8, crashed=true) at PLCrashLogWriter.m:1005:24
    frame #7: 0x00000001029c68b4 MicrosoftPLCrashTests`plcrash_log_writer_write(writer=0x0000000102a2adc8, crashed_thread=1031, image_list=0x0000000102a2ada0, file=0x0000000114223718, siginfo=0x00000001142238b0, current_state=0x00000001142238c0) at PLCrashLogWriter.m:1386:27
    frame #8: 0x00000001029cd0e8 MicrosoftPLCrashTests`plcrash_write_report(sigctx=0x0000000102a2adc8, crashed_thread=1031, thread_state=0x00000001142238c0, siginfo=0x00000001142238b0) at PLCrashReporter.m:165:11
    frame #9: 0x00000001029cb3b8 MicrosoftPLCrashTests`signal_handler_callback(signal=5, info=0x0000000114223bb0, uap=0x0000000114223c18, context=0x0000000102a2adc8, next=0x0000000114223ae8) at PLCrashReporter.m:232:9
    frame #10: 0x00000001029c0e2c MicrosoftPLCrashTests`internal_callback_iterator(signo=5, info=0x0000000114223bb0, uap=0x0000000114223c18, context=0x0000000000000000) at PLCrashSignalHandler.mm:177:23
    frame #11: 0x00000001029c0ce0 MicrosoftPLCrashTests`plcrash_signal_handler(signo=5, info=0x0000000114223bb0, uapVoid=0x0000000114223c18) at PLCrashSignalHandler.mm:201:10
    frame #12: 0x00000001e5fce28c libsystem_platform.dylib`_sigtramp + 72
    frame #13: 0x000000019e95ad88 CoreFoundation`-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]
    frame #14: 0x00000001029bfa10 MicrosoftPLCrashTests`-[ViewController viewDidLoad](self=0x0000000114109330, _cmd="viewDidLoad") at ViewController.m:18:5
    frame #15: 0x00000001a0c95678 UIKitCore`-[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 108
    frame #16: 0x00000001a0c99e14 UIKitCore`-[UIViewController loadViewIfRequired] + 956
    frame #17: 0x00000001a0c9a1d8 UIKitCore`-[UIViewController view] + 32
    frame #18: 0x00000001a13d5424 UIKitCore`-[UIWindow addRootViewControllerViewIfPossible] + 180
    frame #19: 0x00000001a13d4bf8 UIKitCore`-[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 236
    frame #20: 0x00000001a13d5ac8 UIKitCore`-[UIWindow _setHidden:forced:] + 380
    frame #21: 0x00000001a13e6d44 UIKitCore`-[UIWindow _mainQueue_makeKeyAndVisible] + 52
    frame #22: 0x00000001a16052cc UIKitCore`-[UIWindowScene _makeKeyAndVisibleIfNeeded] + 204
    frame #23: 0x00000001a0863f84 UIKitCore`+[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1632
    frame #24: 0x00000001a13961f0 UIKitCore`-[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 1036
    frame #25: 0x00000001a1396578 UIKitCore`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 332
    frame #26: 0x00000001a0eb0274 UIKitCore`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388
    frame #27: 0x00000001ada2c2dc FrontBoardServices`-[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 432
    frame #28: 0x00000001ada56a00 FrontBoardServices`__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.200 + 128
    frame #29: 0x00000001ada3ad24 FrontBoardServices`-[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
    frame #30: 0x00000001ada566d0 FrontBoardServices`__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372
    frame #31: 0x000000019e678ac8 libdispatch.dylib`_dispatch_client_callout + 20
    frame #32: 0x000000019e67c348 libdispatch.dylib`_dispatch_block_invoke_direct + 268
    frame #33: 0x00000001ada7e0e0 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
    frame #34: 0x00000001ada7dd88 FrontBoardServices`-[FBSSerialQueue _targetQueue_performNextIfPossible] + 448
    frame #35: 0x00000001ada7e2ac FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 32
    frame #36: 0x000000019e9f781c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
    frame #37: 0x000000019e9f7718 CoreFoundation`__CFRunLoopDoSource0 + 208
    frame #38: 0x000000019e9f6a94 CoreFoundation`__CFRunLoopDoSources0 + 376
    frame #39: 0x000000019e9f0d20 CoreFoundation`__CFRunLoopRun + 824
    frame #40: 0x000000019e9f04bc CoreFoundation`CFRunLoopRunSpecific + 600
    frame #41: 0x00000001b5475820 GraphicsServices`GSEventRunModal + 164
    frame #42: 0x00000001a1394734 UIKitCore`-[UIApplication _run] + 1072
    frame #43: 0x00000001a1399e10 UIKitCore`UIApplicationMain + 168
    frame #44: 0x00000001029bfed8 MicrosoftPLCrashTests`main(argc=1, argv=0x000000016d447990) at main.m:17:12
    frame #45: 0x000000019e6b7e60 libdyld.dylib`start + 4

I did a bit of digging and expanded out the arm_thread_state64_get_fp() macro defined in in mach/arm/structs.h

	__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
	(uintptr_t)(__tsp->__opaque_fp && !(__tsp->__opaque_flags &       \
	__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ?                   \
	ptrauth_auth_data(__tsp->__opaque_fp,                             \
	ptrauth_key_process_independent_data,                             \
	ptrauth_string_discriminator("fp")) : __tsp->__opaque_fp); })

and the issue seems to be occurring in ptauth_auth_data
The backtrace will prints out the following calling out a possible pointer auth failure:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x200001e8ee661e)
Note: Possible pointer authentication failure detected.
Found value that failed to authenticate at address=0x1e8ee661e.

Repro Steps

  1. add arm64e to Architecture
  2. Crashing using CFRelease(NULL);
  3. the app hangs, and doesn't exit.
  4. attach debugger.
    (I can provide a test project if necessary)

Details

  1. Which SDK version are you using? f5a0a18
  2. Which OS version did you experience the issue on? iOS 14.0.1
  3. Which CocoaPods/Carthage/Xcode version are you using? Xcode 12.0.1
  4. What device version did you see this error on? Were you using an emulator or a physical device? physical device
  5. What language are you using?
    • Objective C
    • Swift
  6. What third party libraries are you using? none

Bulid failure on Xcode 12 GM

Description

I can't build for iOS on Xcode12 GM.

Repro Steps

Please list the steps used to reproduce your issue.

1. Xcode 12 with v1.7.2
  1. Download Xcode 12 GM
  2. Checkout v1.7.2
  3. Choose target CrashReporter iOS Framework / CrashReporter iOS Universal
    • both are failed
2. Xcode 12 with master branch
  1. Download Xcode 12 GM
  2. Checkout master (#af3a0a1248adc690354de07e5e36e8bcc7314e72)
  3. Choose target CrashReporter iOS Framework or CrashReporter iOS Universal
    • CrashReporter iOS Framework succeed
    • CrashReporter iOS Universal failed
      3.1 If I add .xcconfig on project, then both builds are succeed. but carthage was still failed.
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))
3. Carthage
  1. Add dependency on Cartfile
    • github "https://github.com/microsoft/plcrashreporter" >= 1.7.1
  2. carthage update --platform ios
  • (failed)
4. Carthage with .xcconfig
  • I found a workaround related with carthage on xcode 12
  • other projects are works well with upper workaround but plccrashreporer doesn't working.

Details

  1. Which SDK version are you using?
    XCode 12.0 (12A7208)

  2. Which OS version did you experience the issue on?
    iOS 14

  3. Which CocoaPods/Carthage/Xcode version are you using?
    Carhage / XCode

  4. What device version did you see this error on? Were you using an emulator or a physical device?

  • XCode
Showing All Messages
fatal error: lipo: /$USER_HOME/Library/Developer/Xcode/DerivedData/CrashReporter-dvugesngrmqtvbcdmayplbtumulb/Build/Products/Debug-iphoneos/libCrashReporter.a and /$USER_HOME/Library/Developer/Xcode/DerivedData/CrashReporter-dvugesngrmqtvbcdmayplbtumulb/Build/Products/Debug-iphonesimulator/libCrashReporter.a have the same architectures (arm64) and can't be in the same fat output file
  • Carthage

MasterObjectLink /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Intermediates.noindex/CrashReporter.build/Release-iphonesimulator/CrashReporter\ iOS\ Framework.build/Objects-normal/CrashReporter-i386-master.o (in target 'CrashReporter iOS Framework' from project 'CrashReporter')
    cd /$USER_HOME/$PROJECT_HOME/Carthage/Checkouts/plcrashreporter
    /Applications/Xcode_12_GM.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -r -arch i386 -syslibroot /Applications/Xcode_12_GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Intermediates.noindex/CrashReporter.build/Release-iphonesimulator/CrashReporter\ iOS\ Framework.build/Objects-normal/i386/CrashReporterFramework.o /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Products/Release-iphonesimulator/libCrashReporter.a -o /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Intermediates.noindex/CrashReporter.build/Release-iphonesimulator/CrashReporter\ iOS\ Framework.build/Objects-normal/CrashReporter-i386-master.o
ld: file not found: /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Products/Release-iphonesimulator/libCrashReporter.a
Command MasterObjectLink failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
	MasterObjectLink /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b/Build/Intermediates.noindex/CrashReporter.build/Release-iphonesimulator/CrashReporter\ iOS\ Framework.build/Objects-normal/CrashReporter-i386-master.o
(1 failure)
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /$USER_HOME/$PROKJECT_HOME/Carthage/Checkouts/plcrashreporter/CrashReporter.xcodeproj -scheme CrashReporter\ iOS\ Framework -configuration Release -derivedDataPath /$USER_HOME/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/plcrashreporter/d743a2e8805790ca8abfda7200de04f72c99171b -sdk iphonesimulator -destination platform=iOS\ Simulator,id=E62E1B2B-79BA-4D80-902B-3A0A97AA2DF3 -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /$USER_HOME/$PROJECT_HOME/Carthage/Checkouts/plcrashreporter)
  1. What language are you using?

    • [O] Objective C
    • [O] Swift
  2. What third party libraries are you using?

  • NO
  • I tested standalone or simple project

Crash in PLCrashReporter.m

Description

I'm seeing this crash happen when performing a certain action in my app. The action involves XPC and UI updates, and is 100% reproducible. The issue is that the crash seems to be coming from inside PLCrashReporter itself: uncaught_exception_handler + 73 (PLCrashReporter.m:662).

pl.crash.txt

Thread 9 Crashed:: Dispatch queue: com.apple.root.user-initiated-qos
0   libsystem_kernel.dylib        	0x00007fff7069f33a __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff7075be60 pthread_kill + 430
2   libsystem_c.dylib             	0x00007fff70626808 abort + 120
3   org.cindori.Sensei            	0x00000001024f635d uncaught_exception_handler + 73 (PLCrashReporter.m:662)
4   com.apple.CoreFoundation      	0x00007fff366ccb0c __handleUncaughtException + 726
5   libobjc.A.dylib               	0x00007fff6f3b25a3 _objc_terminate() + 90
6   org.cindori.Sensei            	0x00000001024eab91 MSCrashesUncaughtCXXTerminateHandler() + 760 (MSCrashesCXXExceptionHandler.mm:163)
7   libc++abi.dylib               	0x00007fff6d885887 std::__terminate(void (*)()) + 8
8   libc++abi.dylib               	0x00007fff6d885829 std::terminate() + 41
9   libdispatch.dylib             	0x00007fff704fe66c _dispatch_client_callout + 28
10  libdispatch.dylib             	0x00007fff7050caa8 _dispatch_root_queue_drain + 663
11  libdispatch.dylib             	0x00007fff7050d097 _dispatch_worker_thread2 + 92
12  libsystem_pthread.dylib       	0x00007fff707589f7 _pthread_wqthread + 220
13  libsystem_pthread.dylib       	0x00007fff70757b77 start_wqthread + 15

Details

  1. Which SDK version are you using?
    AppCenter SDK 3.1.1

  2. Which OS version did you experience the issue on?
    macOS 10.15.4

  3. Which CocoaPods/Carthage/Xcode version are you using?
    Carthage 0.34.0

  4. What device version did you see this error on? Were you using an emulator or a physical device?
    MacBook Pro 16" 2019

  5. What language are you using?

    • Objective C
    • Swift
  6. What third party libraries are you using?

No shared framework schemes for iOS platform

Hello all.

I have used this fork for some time as it was the only one to build correctly with Carthage. While looking through the official PLCrashReporter repository and working through the build issues, I had seen a post from @ElektrojungeMS citing this fork as an option which provides Carthage compatibility. Up until now I haven't found any problems with its use, however recently I have run into some issues which I've never experienced before. Currently while running a carthage build I get the following message:

Dependency "plcrashreporter" has no shared framework schemes for any of the platforms: iOS

It appears that the only valid scheme which Carthage is able to build is the Mac scheme. This is probably unintended, though I can't quite tell why it's happening. Looking at the schemes, there appear to be unique schemes for iOS, although they have suffixes (iOS-Device, iOS-Simulator). Considering those files haven't been touched in years, I don't think it's anything wrong with the repository. I wonder if any recent changes in Xcode (currently at 10.1) are causing this problem.

Is anyone else running into this issue? Any help is appreciated. Thanks very much.

iOS framework target doesn't work when included as workspace dependency on Xcode 11

I am looking into using this framework for my project and had tremendous difficulty getting it to work properly; in particular the compiler complained that the framework was bundled incorrectly. I noticed the iOS framework target is built by default using the MacOS 10.15 SDK; is this correct? When I changed this to iOS and rebuilt as an iOS-specific framework I was able to use it successfully.

Screen Shot 2020-04-20 at 12 24 17 PM

Perhaps this is intentional, just wanted to point this out and see if I have done something wrong on my end. Thanks for building a great product, I'm looking forward to using it.

Set skip install build setting for iOS static libraries

It's currently set to 'no' which interferes with archiving and deploying on iOS.

Instead of creating a proper archive you can upload to TestFlight it creates an archive of two products: the app, and the static library + headers which is incompatible.

Crash in Flurryplcrash_async_macho_symtab_reader_read

Description

Please describe the issue you are facing using the SDK.

Our user reported a crash in Flurryplcrash_async_macho_symtab_reader_read happen on iOS14.0 (not sure whether happens on other os)

Sample crash log:

Date/Time: 2020-10-27 16:28:46.5423 +0530
Launch Time: 2020-10-27 16:08:01.0157 +0530
OS Version: iPhone OS 14.1 (18A8395)
Release Type: User
Baseband Version: 3.00.01
Report Version: 104

Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<jp.co.rakuten.RakutenSuperSearchTest>:7821 exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 13.300 (user 13.300, system 0.000), 22% CPU", | "Elapsed application CPU time (seconds): 9.973, 17% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0

Application Specific Information:
abort() called

Thread 0 name: CrWebMain Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Flurry_iOS_SDK 0x00000001149be87c Flurryplcrash_async_macho_symtab_reader_read (in Flurry_iOS_SDK) + 80
1 Flurry_iOS_SDK 0x00000001149be860 Flurryplcrash_async_macho_symtab_reader_read (in Flurry_iOS_SDK) + 52
2 Flurry_iOS_SDK 0x00000001149beae0 plcrash_async_macho_find_best_symbol (in Flurry_iOS_SDK) + 72
3 Flurry_iOS_SDK 0x00000001149be9d0 Flurryplcrash_async_macho_find_symbol_by_pc (in Flurry_iOS_SDK) + 132
4 Flurry_iOS_SDK 0x00000001149c0664 Flurryplcrash_async_find_symbol (in Flurry_iOS_SDK) + 116
5 Flurry_iOS_SDK 0x00000001149ba7ac plcrash_writer_write_thread_frame (in Flurry_iOS_SDK) + 96
6 Flurry_iOS_SDK 0x00000001149ba28c plcrash_writer_write_thread (in Flurry_iOS_SDK) + 444
7 Flurry_iOS_SDK 0x00000001149b9b84 Flurryplcrash_log_writer_write (in Flurry_iOS_SDK) + 704
8 Flurry_iOS_SDK 0x00000001149bcdc4 plcrash_write_report (in Flurry_iOS_SDK) + 80
9 Flurry_iOS_SDK 0x00000001149bbddc signal_handler_callback (in Flurry_iOS_SDK) + 100
10 Flurry_iOS_SDK 0x00000001149b82bc internal_callback_iterator(int, __siginfo*, __darwin_ucontext*, void*) (in Flurry_iOS_SDK) + 76
11 Flurry_iOS_SDK 0x00000001149b8220 $_0::~$_0() (in Flurry_iOS_SDK) + 16
12 libsystem_platform.dylib 0x00000001dbc5928c 0x1dbc54000 + 21132
13 libsystem_pthread.dylib 0x00000001dbc5ec74 0x1dbc5c000 + 11380
14 libsystem_c.dylib 0x000000019cea6bb4 0x19ce30000 + 486324
15 Flurry_iOS_SDK 0x00000001149bcebc -[FlurryPLCrashReporter enableCrashReporterAndReturnError:].cold.2 (in Flurry_iOS_SDK) + 20
16 Flurry_iOS_SDK 0x00000001149bbf64 mach_exception_callback (in Flurry_iOS_SDK) + 280
17 CoreFoundation 0x0000000193d6e8b4 0x193c4d000 + 1185972
18 libobjc.A.dylib 0x00000001a7e5c704 0x1a7e52000 + 42756
19 libc++abi.dylib 0x00000001a7f5b2a8 0x1a7f4c000 + 62120
20 libc++abi.dylib 0x00000001a7f5b234 0x1a7f4c000 + 62004
21 libdispatch.dylib 0x000000019396cadc 0x193969000 + 15068
22 libdispatch.dylib 0x0000000193970348 0x193969000 + 29512
23 FrontBoardServices 0x00000001a2daa0e0 0x1a2d4f000 + 372960
24 FrontBoardServices 0x00000001a2da9d88 0x1a2d4f000 + 372104
25 FrontBoardServices 0x00000001a2daa2ac 0x1a2d4f000 + 373420
26 CoreFoundation 0x0000000193ceb81c 0x193c4d000 + 649244
27 CoreFoundation 0x0000000193ceb718 0x193c4d000 + 648984
28 CoreFoundation 0x0000000193ceaa94 0x193c4d000 + 645780
29 CoreFoundation 0x0000000193ce4d20 0x193c4d000 + 621856
30 CoreFoundation 0x0000000193ce44bc 0x193c4d000 + 619708
31 GraphicsServices 0x00000001aa7f6820 0x1aa7f3000 + 14368
32 UIKitCore 0x0000000196691164 0x195b12000 + 12054884
33 UIKitCore 0x0000000196696840 0x195b12000 + 12077120
34 PRODUCT_NAME 0x00000001007830ac 0x10077c000 + 28844
35 PRODUCT_NAME 0x00000001007828a0 0x10077c000 + 26784
36 libdyld.dylib 0x00000001939abe40 0x1939ab000 + 3648

Repro Steps

Please list the steps used to reproduce your issue.

Not reproducible.

Details

  1. Which SDK version are you using? 1.7
  2. Which OS version did you experience the issue on? iOS 14.0
  3. Which CocoaPods/Carthage/Xcode version are you using?
  4. What device version did you see this error on? Were you using an emulator or a physical device? physical device
  5. What language are you using?
    • Objective C
    • Swift
  6. What third party libraries are you using?

Reverting 1.3 changes from master

Hey everyone!

In an effort to keep PLCrashReporter healthy and maintainable moving forward, we are planning to merge some changes we had made in the past in our own fork (which now lives at https://github.com/microsoft/plcrashreporter-fork) into this repo.

Unfortunately, we have seen some instability with the changes that were introduced between 1.2 and 1.3, which is why our fork was always based on 1.2
To align the code from the fork that we ship in HockeyApp and App Center and this repo, we're going to revert the changes from 1.3 out of master and move them to a separate branch.
Note that 1.3 was never properly released and never available as a compiled binary.

Once that is done, we will merge the changes from our fork into master shortly afterwards. Please leave a comment here if you have questions or concerns about this plan!

<redacted> entries in stack trace when using static library in a framework

Description

We have an iOS SDK comprised of frameworks, where in one of the framework, we use the PLCrashReporter APIs in the Swift classes.

As part of Static Linking, The “include” headers are copied to the framework’s xcodeproj and those header names are included in the framework’s module.modulemap file. During linking of the framework, the static library is linked using the “Other Linker Flags” build setting with the flag "--all-load $STATIC_LIBRARY_PATH/libCrashReporter.a" value. This framework builds successfully. But when we use this framework in an app , the app’s crash report contains information like this:

Sample redacted stack trace:

Thread 0:
0 libobjc.A.dylib 0x000000019b1dade8 + 80
1 libobjc.A.dylib 0x000000019b1ca554 object_getMethodImplementation + 48
2 UIKitCore 0x000000019f9d25b4 + 1084
3 UIKitCore 0x000000019f9d2120 + 124
4 UIKitCore 0x000000019ef4ef2c + 104
5 UIKitCore 0x000000019ef4acb8 + 940
6 UIKitCore 0x000000019f9f55ec + 96
7 UIKitCore 0x000000019ef4a8b8 + 236
8 UIKitCore 0x000000019f9fab74 + 204
9 UIKitCore 0x000000019ef4a32c + 1024
10 UIKitCore 0x000000019ef3f3ac + 72
11 UIKitCore 0x000000019f05601c + 104
12 UIKitCore 0x000000019ef3f32c + 176

Details

  1. Which SDK version are you using?
    1.7.2
  2. Which OS version did you experience the issue on?
    MacOS 10.15
  3. Which CocoaPods/Carthage/Xcode version are you using?
    Directly download the PLCrashReporter-Static-1.7.2.zip and using it in Xcode version 12.
  4. What device version did you see this error on? Were you using an emulator or a physical device?
    If the app is distributed via Testflight , the TestFlight crash is different from the one produced by the PLCrashreporter using in a framework
  5. What language are you using?
    • Swift
  6. What third party libraries are you using?
    None

Can you please let us know what are we missing here?

Crash Report not generated

When I run DemoCrash in my system. Even-though app is crashed I never get crash report. What setting does this DemoCrash depends on?
MacOS: 10.15 (19A583)
Xcode: 11.1

Support for more machine info.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Right now plcrashreporter only has couple field from NSException->userInfo->system_info. Is that possible to include all of them? (like ios_jailbroken, device_battery_level, ram_available)

Describe the solution you'd like
A clear and concise description of what you want to happen.

We would love to have all machine info from NSException.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Maybe there could be a way to customise what we parse from NSException.

Additional context
Add any other context about the feature request here.

Getting error on loading pending reports

Description

I am getting, "The file “live_report.plcrash” couldn’t be opened because there is no such file." error when trying load the pending reports.

Repro Steps

Please list the steps used to reproduce your issue.

  1. Tried to simulate a crash in SwiftUI view, the crash happened for array out of bounds
  2. When tried to call the loadPendingReportWithErrors, throws the above error.

Sample code I tried is given below,
On AppLaunch calling's below method -
private func setUpCrashReporter() {
//Crash report Activate
do {
try crashReporter?.enableAndReturnError()
debugPrint("crash report is active")
} catch let error {

    }
    if ((crashReporter?.hasPendingCrashReport()) != nil) {
        self.handleCrashReport()
    }

// if CrashReporter.Shared.crashReportActivate() == true {
// //Crash repoprt is Active
// debugPrint("crash report is active")
// }

    if CrashReporter.Shared.handleCrashReport() == true {
        //crash report can handle the crash
        debugPrint("crash report is handled")
    }
    CrashReporter.Shared.crashReportActivate()
}

func handleCrashReport() -> Bool {
    let data:Data?
    
    guard let crashReporter = PLCrashReporter.shared() else {return false}
    
    do {
        data = try crashReporter.loadPendingCrashReportDataAndReturnError()
        if data != nil { //crashReporter.hasPendingCrashReport()
            let report = try PLCrashReport(data: data!)
            if let formettedCrashReport = PLCrashReportTextFormatter.stringValue(for: report, with: crashTextFormat) {
              
                var identifier:String
                if let UID = report.uuidRef {
                     identifier = "\(UID.hashValue)"
                }else {
                    identifier = UUID().uuidString
                }
                crashReporter.purgePendingCrashReport()
                return true
          }
        }
        
    } catch {
        return false
    }
   return false
}

Details

  1. Which SDK version are you using?
  2. Which OS version did you experience the issue on? - iOS 14
  3. Which CocoaPods/Carthage/Xcode version are you using? - Xcode -12
  4. What device version did you see this error on? Were you using an emulator or a physical device? - In simulator I tried
  5. What language are you using?
    • Swift
  6. What third party libraries are you using? - CrashReporter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.