Skip to content

Commit

Permalink
Merge pull request #68 from WideSpectrumComputing/master
Browse files Browse the repository at this point in the history
Fixing: App terminated due to signal 5 instantiating RollbarPLCrashCollector
  • Loading branch information
akornich authored Apr 16, 2021
2 parents 6fa0b1d + 970c009 commit 9d56010
Show file tree
Hide file tree
Showing 19 changed files with 127 additions and 80 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co

## Release Notes

**2.0.0-beta.10**
- fix: resolve #66 - App terminated due to signal 5 instantiating RollbarPLCrashCollector

**2.0.0-beta8**
- fix: point all the Cocoapods podspecs to proper documentation site.

Expand Down
11 changes: 9 additions & 2 deletions Demos/iosAppObjC/iosAppObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
5533980A2627F4670031D02C /* RollbarPLCrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 553398092627F4670031D02C /* RollbarPLCrashReporter */; };
55684F702553B4C400F82F34 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 55684F6F2553B4C400F82F34 /* AppDelegate.m */; };
55684F732553B4C400F82F34 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 55684F722553B4C400F82F34 /* SceneDelegate.m */; };
55684F762553B4C400F82F34 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55684F752553B4C400F82F34 /* ViewController.m */; };
Expand Down Expand Up @@ -44,6 +45,7 @@
files = (
55684F912553B7EE00F82F34 /* RollbarNotifier in Frameworks */,
55684F9D2553BD1C00F82F34 /* NetworkExtension.framework in Frameworks */,
5533980A2627F4670031D02C /* RollbarPLCrashReporter in Frameworks */,
55684F8D2553B7E100F82F34 /* RollbarDeploys in Frameworks */,
55684F8F2553B7E800F82F34 /* RollbarKSCrash in Frameworks */,
);
Expand Down Expand Up @@ -116,6 +118,7 @@
55684F8C2553B7E100F82F34 /* RollbarDeploys */,
55684F8E2553B7E800F82F34 /* RollbarKSCrash */,
55684F902553B7EE00F82F34 /* RollbarNotifier */,
553398092627F4670031D02C /* RollbarPLCrashReporter */,
);
productName = iosAppObjC;
productReference = 55684F6B2553B4C400F82F34 /* iosAppObjC.app */;
Expand Down Expand Up @@ -319,7 +322,7 @@
CODE_SIGN_ENTITLEMENTS = iosAppObjC/iosAppObjC.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = LDX6L68VZJ;
INFOPLIST_FILE = iosAppObjC/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -340,7 +343,7 @@
CODE_SIGN_ENTITLEMENTS = iosAppObjC/iosAppObjC.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = LDX6L68VZJ;
INFOPLIST_FILE = iosAppObjC/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -377,6 +380,10 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
553398092627F4670031D02C /* RollbarPLCrashReporter */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarPLCrashReporter;
};
55684F8C2553B7E100F82F34 /* RollbarDeploys */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarDeploys;
Expand Down
14 changes: 7 additions & 7 deletions Demos/iosAppObjC/iosAppObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

@import RollbarNotifier;
@import RollbarKSCrash;

@interface AppDelegate ()

@end
@import RollbarPLCrashReporter;

@implementation AppDelegate

Expand Down Expand Up @@ -73,14 +70,17 @@ - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<

- (void)initRollbar {

// configure Rollbar:
// configure Rollbar:
RollbarConfig *config = [RollbarConfig new];

config.destination.accessToken = @"2ffc7997ed864dda94f63e7b7daae0f3";
config.destination.environment = @"samples";
config.customData = @{ @"someKey": @"someValue", };
// init Rollbar shared instance:
id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init];

// init Rollbar shared instance:
//id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init];
id<RollbarCrashCollector> crashCollector = [[RollbarPLCrashCollector alloc] init];

[Rollbar initWithConfiguration:config crashCollector:crashCollector];

[Rollbar infoMessage:@"Rollbar is up and running! Enjoy your remote error and log monitoring..."];
Expand Down
6 changes: 1 addition & 5 deletions Demos/iosAppObjC/iosAppObjC/iosAppObjC.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>packet-tunnel-provider</string>
</array>
<array/>
</dict>
</plist>
22 changes: 11 additions & 11 deletions Demos/macosAppObjC/macosAppObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@import RollbarNotifier;

//@import RollbarKSCrash;
@import RollbarKSCrash;
@import RollbarPLCrashReporter;

__attribute__((noinline)) static void crashIt (void) {
Expand Down Expand Up @@ -55,14 +55,14 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

// now, cause a crash:

//[self callTroublemaker];
//@throw NSInternalInconsistencyException;
//[self performSelector:@selector(die_die)];
//[self performSelector:NSSelectorFromString(@"crashme:") withObject:nil afterDelay:10];
//assert(NO);
//exit(0);
//crashIt();

[self callTroublemaker];
@throw NSInternalInconsistencyException;
[self performSelector:@selector(die_die)];
[self performSelector:NSSelectorFromString(@"crashme:") withObject:nil afterDelay:10];
assert(NO);
exit(0);
crashIt();
}


Expand All @@ -84,9 +84,9 @@ - (void)initRollbar {

// optional crash reporter:
id<RollbarCrashCollector> crashCollector =
nil;
//nil;
//[[RollbarKSCrashCollector alloc] init];
//[[RollbarPLCrashCollector alloc] init];
[[RollbarPLCrashCollector alloc] init];

// init Rollbar shared instance:
[Rollbar initWithConfiguration:config crashCollector:crashCollector];
Expand Down
5 changes: 3 additions & 2 deletions Demos/macosAppSwiftCocoapods/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ platform :osx, '10.12'
use_frameworks!

target 'macosAppSwiftCocoapods' do
pod 'RollbarNotifier', '~> 2.0.0-alpha10'
pod 'RollbarDeploys', '~> 2.0.0-alpha10'
pod 'RollbarNotifier', '~> 2.0.0-beta9'
pod 'RollbarPLCrashReporter', '~> 2.0.0-beta9'
pod 'RollbarDeploys', '~> 2.0.0-beta9'
pod 'SwiftTryCatch2', '~> 2.0.2'
end
33 changes: 21 additions & 12 deletions Demos/macosAppSwiftCocoapods/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
PODS:
- RollbarCommon (2.0.0-alpha10)
- RollbarDeploys (2.0.0-alpha10):
- RollbarCommon (~> 2.0.0-alpha10)
- RollbarNotifier (2.0.0-alpha10):
- RollbarCommon (~> 2.0.0-alpha10)
- PLCrashReporter (1.8.1)
- RollbarCommon (2.0.0-beta9)
- RollbarDeploys (2.0.0-beta9):
- RollbarCommon (~> 2.0.0-beta9)
- RollbarNotifier (2.0.0-beta9):
- RollbarCommon (~> 2.0.0-beta9)
- RollbarPLCrashReporter (2.0.0-beta9):
- PLCrashReporter (~> 1.8.1)
- RollbarCommon (~> 2.0.0-beta9)
- SwiftTryCatch2 (2.0.2)

DEPENDENCIES:
- RollbarDeploys (~> 2.0.0-alpha10)
- RollbarNotifier (~> 2.0.0-alpha10)
- RollbarDeploys (~> 2.0.0-beta9)
- RollbarNotifier (~> 2.0.0-beta9)
- RollbarPLCrashReporter (~> 2.0.0-beta9)
- SwiftTryCatch2 (~> 2.0.2)

SPEC REPOS:
trunk:
- PLCrashReporter
- RollbarCommon
- RollbarDeploys
- RollbarNotifier
- RollbarPLCrashReporter
- SwiftTryCatch2

SPEC CHECKSUMS:
RollbarCommon: 52e3c363f086892067f0a5441e41bd9085d3e5ea
RollbarDeploys: b5c2bd3e81051e6c43c27c002ea96770b0c3ad33
RollbarNotifier: 6718ee9289226025e1c21e480681d2f253b46bf7
PLCrashReporter: ea2d252e930f538a9f70f0b81bc9cce656651fbf
RollbarCommon: 0afe35e303d8ddb05bd0d5e24761fc3affee7000
RollbarDeploys: 5eb0141692dc8b26f85c23594fdb4cb5eefd5592
RollbarNotifier: d77402ae53edca08e6dcc272147965b2dfc99788
RollbarPLCrashReporter: 21f3104db1322d8b712aa16f282d9d79c0db9bb0
SwiftTryCatch2: a1b6e301b0b1cc1c1af9849f13969979c706ff5e

PODFILE CHECKSUM: 67529d6dedcfb826f7616a719a8416f3036c8986
PODFILE CHECKSUM: d66c1189dc3566db72d76263a3cf457dfe83e099

COCOAPODS: 1.9.3
COCOAPODS: 1.10.1
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
55897B5A249AF55800C0DB50 /* Frameworks */,
55897B5B249AF55800C0DB50 /* Resources */,
3026AAC828926FEC1AD7A7F2 /* [CP] Embed Pods Frameworks */,
8E785FC25997F97402972ACD /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -121,7 +122,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1150;
LastUpgradeCheck = 1150;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "Andrey Kornich (Wide Spectrum Computing LLC)";
TargetAttributes = {
55897B5C249AF55800C0DB50 = {
Expand Down Expand Up @@ -199,6 +200,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
8E785FC25997F97402972ACD /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-macosAppSwiftCocoapods/Pods-macosAppSwiftCocoapods-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-macosAppSwiftCocoapods/Pods-macosAppSwiftCocoapods-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-macosAppSwiftCocoapods/Pods-macosAppSwiftCocoapods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -252,6 +270,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -312,6 +331,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Cocoa
import RollbarNotifier
import RollbarPLCrashReporter
import SwiftTryCatch2

@NSApplicationMain
Expand All @@ -22,29 +23,33 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.callTroublemaker();
},
catchRun: { (exception) in
Rollbar.error("Got an exception!", exception: exception)
Rollbar.log(RollbarLevel.error, exception: exception!)
},
finallyRun: {
Rollbar.info("Post-trouble notification!");
Rollbar.log(RollbarLevel.info, message:"Post-trouble notification!");
})
}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
Rollbar.info("The hosting application is terminating...");
Rollbar.log(RollbarLevel.info, message:"The hosting application is terminating...");
}

func initRollbar() {

// configure Rollbar:
let config = RollbarConfiguration.init();

let config = RollbarConfig();
//config.crashLevel = @"critical";
config.environment = "samples";
config.asRollbarConfig().customData = [ "someKey": "someValue", ];
config.destination.accessToken = "2ffc7997ed864dda94f63e7b7daae0f3";
config.destination.environment = "samples";
config.customData = [ "someKey": "someValue", ];

//let crashCollector = RollbarPLCrashCollector();

// init Rollbar shared instance:
Rollbar.initWithAccessToken("2ffc7997ed864dda94f63e7b7daae0f3", configuration: config);
Rollbar.info("Rollbar is up and running! Enjoy your remote error and log monitoring...");
Rollbar.initWithConfiguration(config, crashCollector: nil);//crashCollector);
Rollbar.log(RollbarLevel.info,
message:"Rollbar is up and running! Enjoy your remote error and log monitoring...");
}

func demonstrateDeployApiUasege() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ class RollbarDeploysObserver
}

class RollbarDeploysDemoClient {

func demoDeploymentRegistration() {

let dateFormatter = DateFormatter();
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss";

let environment = "unit-tests123";
let comment = "a new deploy at \(dateFormatter.string(from: Date()))";
let revision = "a_revision";
let localUsername = "UnitTestRunner";
let rollbarUsername = "rollbar";

let observer = RollbarDeploysObserver()
let deployment = RollbarDeployment(
environment: environment,
Expand All @@ -70,11 +70,11 @@ class RollbarDeploysDemoClient {
deploymentRegistrationObserver: (observer as! NSObjectProtocol & RollbarDeploymentRegistrationObserver),
deploymentDetailsObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsObserver),
deploymentDetailsPageObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsPageObserver));
deploysManager!.register(deployment!)
deploysManager.register(deployment!)
}

func demoGetDeploymentDetailsById() {

let testDeploymentId = "9961771";
let observer = RollbarDeploysObserver();
let deploysManager = RollbarDeploysManager(
Expand All @@ -83,19 +83,19 @@ class RollbarDeploysDemoClient {
deploymentRegistrationObserver: (observer as! NSObjectProtocol & RollbarDeploymentRegistrationObserver),
deploymentDetailsObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsObserver),
deploymentDetailsPageObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsPageObserver));
deploysManager!.getDeploymentWithDeployId(testDeploymentId);
deploysManager.getDeploymentWithDeployId(testDeploymentId);
}

func demoGetDeploymentsPage() {

let observer = RollbarDeploysObserver();
let deploysManager = RollbarDeploysManager(
writeAccessToken: "0d7ef175a2e14bc9b48732af2b2652f9",
readAccessToken: "d1fd12f1bd7e4340a0a55378d41061f0",
deploymentRegistrationObserver: (observer as! NSObjectProtocol & RollbarDeploymentRegistrationObserver),
deploymentDetailsObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsObserver),
deploymentDetailsPageObserver: (observer as! NSObjectProtocol & RollbarDeploymentDetailsPageObserver));
deploysManager!.getDeploymentsPageNumber(1);
deploysManager.getDeploymentsPageNumber(1);
}
}

Expand Down
Loading

0 comments on commit 9d56010

Please sign in to comment.