Skip to content

Commit

Permalink
deps(react-native): Update bugsnag-cocoa to v6.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Aug 6, 2021
1 parent 2aa6047 commit 50e57e3
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
[bugsnag-android#1331](https://github.com/bugsnag/bugsnag-android/pull/1331)
- Address pre-existing StrictMode violations
[bugsnag-android#1328](https://github.com/bugsnag/bugsnag-android/pull/1328)
- (react-native): Update bugsnag-cocoa to v6.10.3
- Fix another rare crash in `bsg_ksmachgetThreadQueueName`. [bugsnag-cocoa#1157](https://github.com/bugsnag/bugsnag-cocoa/pull/1157)

## 7.11.0 (2021-07-26)

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ios/.bugsnag-cocoa-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3850d4cd88f3eeabc8fff271a1b08a6a6d4e381a
cc4b9f0815e09ef4de80b4ed09194085ac2889f7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.10.2",
"version": "6.10.3",
"summary": "The Bugsnag crash reporting framework for Apple platforms.",
"homepage": "https://bugsnag.com",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
},
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa.git",
"tag": "v6.10.2"
"tag": "v6.10.3"
},
"frameworks": [
"Foundation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@
008967A82486D43700DC48C2 /* KSCrashIdentifierTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966E92486D43700DC48C2 /* KSCrashIdentifierTests.m */; };
008967A92486D43700DC48C2 /* KSCrashIdentifierTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966E92486D43700DC48C2 /* KSCrashIdentifierTests.m */; };
008967AA2486D43700DC48C2 /* KSCrashIdentifierTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966E92486D43700DC48C2 /* KSCrashIdentifierTests.m */; };
008967AB2486D43700DC48C2 /* KSMach_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* KSMach_Tests.m */; };
008967AC2486D43700DC48C2 /* KSMach_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* KSMach_Tests.m */; };
008967AD2486D43700DC48C2 /* KSMach_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* KSMach_Tests.m */; };
008967AB2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* BSG_KSMachTests.m */; };
008967AC2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* BSG_KSMachTests.m */; };
008967AD2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 008966EA2486D43700DC48C2 /* BSG_KSMachTests.m */; };
008967B42486D9D800DC48C2 /* BugsnagBreadcrumbs.m in Sources */ = {isa = PBXBuildFile; fileRef = 008967B22486D9D700DC48C2 /* BugsnagBreadcrumbs.m */; };
008967B52486D9D800DC48C2 /* BugsnagBreadcrumbs.m in Sources */ = {isa = PBXBuildFile; fileRef = 008967B22486D9D700DC48C2 /* BugsnagBreadcrumbs.m */; };
008967B62486D9D800DC48C2 /* BugsnagBreadcrumbs.m in Sources */ = {isa = PBXBuildFile; fileRef = 008967B22486D9D700DC48C2 /* BugsnagBreadcrumbs.m */; };
Expand Down Expand Up @@ -1132,7 +1132,7 @@
008966E72486D43700DC48C2 /* KSCrashSentry_Signal_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSCrashSentry_Signal_Tests.m; sourceTree = "<group>"; };
008966E82486D43700DC48C2 /* KSString_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSString_Tests.m; sourceTree = "<group>"; };
008966E92486D43700DC48C2 /* KSCrashIdentifierTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSCrashIdentifierTests.m; sourceTree = "<group>"; };
008966EA2486D43700DC48C2 /* KSMach_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSMach_Tests.m; sourceTree = "<group>"; };
008966EA2486D43700DC48C2 /* BSG_KSMachTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSG_KSMachTests.m; sourceTree = "<group>"; };
008967AE2486D6E100DC48C2 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Makefile; sourceTree = SOURCE_ROOT; };
008967B22486D9D700DC48C2 /* BugsnagBreadcrumbs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BugsnagBreadcrumbs.m; sourceTree = "<group>"; };
008967B32486D9D700DC48C2 /* BugsnagBreadcrumbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BugsnagBreadcrumbs.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1478,6 +1478,8 @@
008966D32486D43700DC48C2 /* KSCrash */ = {
isa = PBXGroup;
children = (
008966D82486D43700DC48C2 /* BSG_KSMachHeadersTests.m */,
008966EA2486D43700DC48C2 /* BSG_KSMachTests.m */,
008966D62486D43700DC48C2 /* FileBasedTestCase.h */,
008966E42486D43700DC48C2 /* FileBasedTestCase.m */,
008966E92486D43700DC48C2 /* KSCrashIdentifierTests.m */,
Expand All @@ -1489,8 +1491,6 @@
008966E52486D43700DC48C2 /* KSFileUtils_Tests.m */,
008966E02486D43700DC48C2 /* KSJSONCodec_Tests.m */,
008966DA2486D43700DC48C2 /* KSLogger_Tests.m */,
008966EA2486D43700DC48C2 /* KSMach_Tests.m */,
008966D82486D43700DC48C2 /* BSG_KSMachHeadersTests.m */,
008966E12486D43700DC48C2 /* KSSignalInfo_Tests.m */,
008966E82486D43700DC48C2 /* KSString_Tests.m */,
008966D52486D43700DC48C2 /* KSSysCtl_Tests.m */,
Expand Down Expand Up @@ -2704,7 +2704,7 @@
008967542486D43700DC48C2 /* BugsnagOnCrashTest.m in Sources */,
008967152486D43700DC48C2 /* BugsnagCollectionsTests.m in Sources */,
01E8765E256684E700F4B70A /* URLSessionMock.m in Sources */,
008967AB2486D43700DC48C2 /* KSMach_Tests.m in Sources */,
008967AB2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */,
0089672A2486D43700DC48C2 /* BugsnagStacktraceTest.m in Sources */,
01847DAC26441A5E00ADA4C7 /* BSGInternalErrorReporterTests.m in Sources */,
0163BF5925823D8D008DC28B /* NotificationBreadcrumbTests.m in Sources */,
Expand Down Expand Up @@ -2858,7 +2858,7 @@
008967012486D43700DC48C2 /* BugsnagEventPersistLoadTest.m in Sources */,
008967702486D43700DC48C2 /* NSError+SimpleConstructor_Tests.m in Sources */,
0089671C2486D43700DC48C2 /* BugsnagSessionTest.m in Sources */,
008967AC2486D43700DC48C2 /* KSMach_Tests.m in Sources */,
008967AC2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */,
0163BF5A25823D8D008DC28B /* NotificationBreadcrumbTests.m in Sources */,
01BDB1FD25DEBFB300A91FAF /* BSGEventUploadKSCrashReportOperationTests.m in Sources */,
00896A452486DBF000DC48C2 /* BugsnagConfigurationTests.m in Sources */,
Expand Down Expand Up @@ -3022,7 +3022,7 @@
008967022486D43700DC48C2 /* BugsnagEventPersistLoadTest.m in Sources */,
008967712486D43700DC48C2 /* NSError+SimpleConstructor_Tests.m in Sources */,
0089671D2486D43700DC48C2 /* BugsnagSessionTest.m in Sources */,
008967AD2486D43700DC48C2 /* KSMach_Tests.m in Sources */,
008967AD2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */,
00896A462486DBF000DC48C2 /* BugsnagConfigurationTests.m in Sources */,
0089674A2486D43700DC48C2 /* BugsnagUserTest.m in Sources */,
0089673B2486D43700DC48C2 /* BugsnagEventFromKSCrashReportTest.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<AdditionalOptions>
<AdditionalOption
key = "MallocScribble"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<AdditionalOptions>
<AdditionalOption
key = "MallocScribble"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<AdditionalOptions>
<AdditionalOption
key = "MallocScribble"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ - (BugsnagEvent *)loadEventAndReturnError:(NSError * __autoreleasing *)errorPtr
if (!json) {
NSMutableDictionary *diagnostics = [NSMutableDictionary dictionary];
diagnostics[@"data"] = [data base64EncodedStringWithOptions:0];
diagnostics[@"file"] = self.file;
ReportInternalError(@"JSON parsing error", BSGErrorDescription(error), diagnostics);
if (errorPtr) {
*errorPtr = error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,31 +326,41 @@ bool bsg_ksmachgetThreadQueueName(const thread_t thread, char *const buffer,
return false;
}

const char *queue_name = dispatch_queue_get_label(dispatch_queue);
if (queue_name == NULL) {
// If the thread is being / has recently been destroyed, we can end up with
// pointers to deallocated memory. Using vm_read_overwrite allows us to
// avoid crashing in this scenario, but we need to check that the copied
// data looks like a valid string.
const void *ptr = dispatch_queue_get_label(dispatch_queue);

vm_size_t bytesRead = 0;
// Not using bsg_ksmachcopyMem because it does not return bytesRead
kr = vm_read_overwrite(mach_task_self(),
(vm_address_t)ptr, (vm_size_t)bufLength - 1,
(vm_address_t)buffer, &bytesRead);
if (kr != KERN_SUCCESS) {
BSG_KSLOG_TRACE("Error while getting dispatch queue name : %p",
dispatch_queue);
buffer[0] = '\0';
return false;
}
BSG_KSLOG_TRACE("Dispatch queue name: %s", queue_name);
size_t length = strlen(queue_name);

buffer[bytesRead] = '\0';

BSG_KSLOG_TRACE("Dispatch queue name: %s", buffer);

// Queue label must be a null terminated string.
size_t iLabel;
for (iLabel = 0; iLabel < length + 1; iLabel++) {
if (queue_name[iLabel] < ' ' || queue_name[iLabel] > '~') {
for (iLabel = 0; iLabel < bytesRead; iLabel++) {
if (buffer[iLabel] < ' ' || buffer[iLabel] > '~') {
break;
}
}
if (queue_name[iLabel] != 0) {
if (buffer[iLabel] != 0) {
// Found a non-null, invalid char.
BSG_KSLOG_TRACE("Queue label contains invalid chars");
buffer[0] = '\0';
return false;
}
bufLength =
MIN(length, bufLength - 1); // just strlen, without null-terminator
strncpy(buffer, queue_name, bufLength);
buffer[bufLength] = 0; // terminate string
BSG_KSLOG_TRACE("Queue label = %s", buffer);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (instancetype)init {
#else
self.name = @"Bugsnag Objective-C";
#endif
self.version = @"6.10.2";
self.version = @"6.10.3";
self.url = @"https://github.com/bugsnag/bugsnag-cocoa";
self.dependencies = [NSMutableArray new];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@
//

#import "BSGFileLocations.h"

#import "BSGInternalErrorReporter.h"
#import "BugsnagLogger.h"

static void ReportInternalError(NSString *errorClass, NSError *error) {
NSString *file = @(__FILE__).lastPathComponent;
NSString *message = BSGErrorDescription(error);
NSString *groupingHash = [NSString stringWithFormat:@"%@: %@: %@ %ld", file, errorClass, error.domain, (long)error.code];
[BSGInternalErrorReporter.sharedInstance reportErrorWithClass:errorClass message:message diagnostics:error.userInfo groupingHash:groupingHash];
}

static BOOL ensureDirExists(NSString *path) {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;
if(![fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
bsg_log_err(@"Could not create directory %@: %@", path, error);
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
ReportInternalError(@"Could not create directory", error);
});
return NO;
}
return YES;
Expand Down
7 changes: 7 additions & 0 deletions packages/react-native/ios/vendor/bugsnag-cocoa/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## 6.10.3 (2021-08-04)

### Bug fixes

* Fix another rare crash in `bsg_ksmachgetThreadQueueName`.
[#1157](https://github.com/bugsnag/bugsnag-cocoa/pull/1157)

## 6.10.2 (2021-07-14)

### Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.10.2</string>
<string>6.10.3</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ios/vendor/bugsnag-cocoa/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.10.2
6.10.3

0 comments on commit 50e57e3

Please sign in to comment.