Skip to content

Commit

Permalink
Merge pull request #1508 from bugsnag/release-v6.25.1
Browse files Browse the repository at this point in the history
Release v6.25.1
  • Loading branch information
kstenerud committed Dec 7, 2022
2 parents 056b1c1 + be81824 commit 8a692ad
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 72 deletions.
58 changes: 58 additions & 0 deletions .buildkite/pipeline.full.yml
Expand Up @@ -7,6 +7,64 @@ steps:
# E2E tests
#

- label: 'iOS 15 E2E tests batch 1'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/ios/output/ipa_url.txt"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: cocoa-maze-runner
run: cocoa-maze-runner
command:
- "--app=@build/ipa_url.txt"
- "--farm=bs"
- "--device=IOS_15"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[e-z].*.feature$"
- "--order=random"
concurrency: 24
concurrency_group: browserstack-app
concurrency_method: eager
retry:
automatic:
- exit_status: -1 # Agent was lost
limit: 2

- label: 'iOS 15 E2E tests batch 2'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/ios/output/ipa_url.txt"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: cocoa-maze-runner
run: cocoa-maze-runner
command:
- "--app=@build/ipa_url.txt"
- "--farm=bs"
- "--device=IOS_15"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[a-d].*.feature$"
- "--order=random"
concurrency: 24
concurrency_group: browserstack-app
concurrency_method: eager
retry:
automatic:
- exit_status: -1 # Agent was lost
limit: 2

- label: 'iOS 14 E2E tests batch 1'
depends_on:
- cocoa_fixture
Expand Down
18 changes: 4 additions & 14 deletions .buildkite/pipeline.yml
Expand Up @@ -2,16 +2,6 @@ env:
LANG: "en_GB.UTF-8"

steps:
- label: 'Trigger RN tests for all builds of our next branch'
if: build.branch == "next"
trigger: 'bugsnag-js'
build:
branch: 'next'
message: 'Run RN tests with latest Cocoa next branch'
env:
BUILD_RN_WITH_LATEST_NATIVES: "true"
async: true

##############################################################################
#
# Build
Expand Down Expand Up @@ -216,7 +206,7 @@ steps:
# Barebones E2E tests
#

- label: 'iOS 15 E2E tests batch 1'
- label: 'iOS 16 E2E tests batch 1'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
Expand All @@ -232,7 +222,7 @@ steps:
command:
- "--app=@build/ipa_url.txt"
- "--farm=bs"
- "--device=IOS_15"
- "--device=IOS_16"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[e-z].*.feature$"
Expand All @@ -245,7 +235,7 @@ steps:
- exit_status: -1 # Agent was lost
limit: 2

- label: 'iOS 15 E2E tests batch 2'
- label: 'iOS 16 E2E tests batch 2'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
Expand All @@ -261,7 +251,7 @@ steps:
command:
- "--app=@build/ipa_url.txt"
- "--farm=bs"
- "--device=IOS_15"
- "--device=IOS_16"
- "--appium-version=1.21.0"
- "--fail-fast"
- "--exclude=features/[a-d].*.feature$"
Expand Down
4 changes: 2 additions & 2 deletions .jazzy.yaml
Expand Up @@ -2,11 +2,11 @@ author_url: "https://www.bugsnag.com"
author: "Bugsnag Inc"
clean: false # avoid deleting docs/.git
framework_root: "Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.25.0/Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.25.1/Bugsnag"
github_url: "https://github.com/bugsnag/bugsnag-cocoa"
hide_documentation_coverage: true
module: "Bugsnag"
module_version: "6.25.0"
module_version: "6.25.1"
objc: true
output: "docs"
readme: "README.md"
Expand Down
4 changes: 2 additions & 2 deletions Bugsnag.podspec.json
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.25.0",
"version": "6.25.1",
"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.25.0"
"tag": "v6.25.1"
},
"ios": {
"frameworks": [
Expand Down
78 changes: 40 additions & 38 deletions Bugsnag/Helpers/BSGAppHangDetector.m
Expand Up @@ -122,46 +122,48 @@ - (void)detectAppHangs {
NSThread.currentThread.name = @"com.bugsnag.app-hang-detector";

while (!self.shouldStop) {
if (dispatch_semaphore_wait(self.processingStarted, DISPATCH_TIME_FOREVER) != 0) {
bsg_log_err(@"BSGAppHangDetector: dispatch_semaphore_wait failed unexpectedly");
return;
}

const dispatch_time_t deadline = self.processingDeadline;

if (dispatch_semaphore_wait(self.processingFinished, deadline) == 0) {
// Run loop finished within the deadline
continue;
}

BOOL shouldReportAppHang = YES;

if (dispatch_time(DISPATCH_TIME_NOW, 0) > dispatch_time(deadline, 1 * NSEC_PER_SEC)) {
// If this thread has woken up long after the deadline, the app may have been suspended.
bsg_log_debug(@"Ignoring potential false positive app hang");
shouldReportAppHang = NO;
}

@autoreleasepool {
if (dispatch_semaphore_wait(self.processingStarted, DISPATCH_TIME_FOREVER) != 0) {
bsg_log_err(@"BSGAppHangDetector: dispatch_semaphore_wait failed unexpectedly");
return;
}

const dispatch_time_t deadline = self.processingDeadline;

if (dispatch_semaphore_wait(self.processingFinished, deadline) == 0) {
// Run loop finished within the deadline
continue;
}

BOOL shouldReportAppHang = YES;

if (dispatch_time(DISPATCH_TIME_NOW, 0) > dispatch_time(deadline, 1 * NSEC_PER_SEC)) {
// If this thread has woken up long after the deadline, the app may have been suspended.
bsg_log_debug(@"Ignoring potential false positive app hang");
shouldReportAppHang = NO;
}

#if defined(DEBUG) && DEBUG
if (shouldReportAppHang && bsg_ksmachisBeingTraced()) {
bsg_log_debug(@"Ignoring app hang because debugger is attached");
shouldReportAppHang = NO;
}
if (shouldReportAppHang && bsg_ksmachisBeingTraced()) {
bsg_log_debug(@"Ignoring app hang because debugger is attached");
shouldReportAppHang = NO;
}
#endif

if (shouldReportAppHang && !bsg_runContext->isForeground && !self.delegate.configuration.reportBackgroundAppHangs) {
bsg_log_debug(@"Ignoring app hang because app is in the background");
shouldReportAppHang = NO;
}

if (shouldReportAppHang) {
[self appHangDetected];
}

dispatch_semaphore_wait(self.processingFinished, DISPATCH_TIME_FOREVER);

if (shouldReportAppHang) {
[self appHangEnded];

if (shouldReportAppHang && !bsg_runContext->isForeground && !self.delegate.configuration.reportBackgroundAppHangs) {
bsg_log_debug(@"Ignoring app hang because app is in the background");
shouldReportAppHang = NO;
}

if (shouldReportAppHang) {
[self appHangDetected];
}

dispatch_semaphore_wait(self.processingFinished, DISPATCH_TIME_FOREVER);

if (shouldReportAppHang) {
[self appHangEnded];
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions Bugsnag/Helpers/BSGInternalErrorReporter.m
Expand Up @@ -281,6 +281,8 @@ - (void)sendEvent:(nonnull BugsnagEvent *)event {

// MARK: -

// Intentionally differs from +[BSG_KSSystemInfo deviceAndAppHash]
// See ROAD-1488
static NSString * DeviceId() {
CC_SHA1_CTX ctx;
CC_SHA1_Init(&ctx);
Expand Down Expand Up @@ -312,8 +314,8 @@ - (void)sendEvent:(nonnull BugsnagEvent *)event {
char hex[2 * sizeof(md)];
for (size_t i = 0; i < sizeof(md); i++) {
static char lookup[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
hex[i * 2 + 0] = lookup[(md[i] & 0x0f)];
hex[i * 2 + 1] = lookup[(md[i] & 0xf0) >> 8];
hex[i * 2 + 0] = lookup[(md[i] & 0xf0) >> 4];
hex[i * 2 + 1] = lookup[(md[i] & 0x0f)];
}
return [[NSString alloc] initWithBytes:hex length:sizeof(hex) encoding:NSASCIIStringEncoding];
}
Expand Down
2 changes: 1 addition & 1 deletion Bugsnag/Helpers/BSGSerialization.h
Expand Up @@ -25,7 +25,7 @@ typedef struct _BSGTruncateContext {
NSUInteger length;
} BSGTruncateContext;

NSString * BSGTruncateString(BSGTruncateContext *context, NSString *string);
NSString * BSGTruncateString(BSGTruncateContext *context, NSString *_Nullable string);

id BSGTruncateStrings(BSGTruncateContext *context, id object);

Expand Down
9 changes: 9 additions & 0 deletions Bugsnag/Payload/BugsnagEvent.m
Expand Up @@ -728,6 +728,15 @@ - (void)truncateStrings:(NSUInteger)maxLength {
.maxLength = maxLength
};

if (self.context) {
self.context = BSGTruncateString(&context, self.context);
}

for (BugsnagError *error in self.errors) {
error.errorClass = BSGTruncateString(&context, error.errorClass);
error.errorMessage = BSGTruncateString(&context, error.errorMessage);
}

for (BugsnagBreadcrumb *breadcrumb in self.breadcrumbs) {
breadcrumb.message = BSGTruncateString(&context, breadcrumb.message);
breadcrumb.metadata = BSGTruncateStrings(&context, breadcrumb.metadata);
Expand Down
2 changes: 1 addition & 1 deletion Bugsnag/Payload/BugsnagNotifier.m
Expand Up @@ -23,7 +23,7 @@ - (instancetype)init {
#else
_name = @"Bugsnag Objective-C";
#endif
_version = @"6.25.0";
_version = @"6.25.1";
_url = @"https://github.com/bugsnag/bugsnag-cocoa";
_dependencies = @[];
}
Expand Down
6 changes: 3 additions & 3 deletions BugsnagNetworkRequestPlugin.podspec.json
@@ -1,16 +1,16 @@
{
"name": "BugsnagNetworkRequestPlugin",
"version": "6.25.0",
"version": "6.25.1",
"summary": "Network request monitoring support for Bugsnag.",
"homepage": "https://bugsnag.com",
"license": "MIT",
"authors": {
"Bugsnag": "notifiers@bugsnag.com"
},
"readme": "https://raw.githubusercontent.com/bugsnag/bugsnag-cocoa/v6.25.0/BugsnagNetworkRequestPlugin/README.md",
"readme": "https://raw.githubusercontent.com/bugsnag/bugsnag-cocoa/v6.25.1/BugsnagNetworkRequestPlugin/README.md",
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa.git",
"tag": "v6.25.0"
"tag": "v6.25.1"
},
"dependencies": {
"Bugsnag": "~> 6.13"
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,16 @@
Changelog
=========

## 6.25.1 (2022-12-07)

### Bug fixes

* Fix memory leak in the app hang detection code.
[#1507](https://github.com/bugsnag/bugsnag-cocoa/pull/1507)

* Truncate additional data to reduce number of oversized payloads.
[#1501](https://github.com/bugsnag/bugsnag-cocoa/pull/1501)

## 6.25.0 (2022-10-26)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Framework/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.25.0</string>
<string>6.25.1</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Tests/BugsnagTests/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>6.25.0</string>
<string>6.25.1</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestHost-iOS/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>6.25.0</string>
<string>6.25.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
6.25.0
6.25.1
5 changes: 2 additions & 3 deletions features/crashprobe.feature
Expand Up @@ -139,9 +139,8 @@ Feature: Reporting crash events
And the exception "message" matches "Attempted to dereference (garbage|null) pointer"
And the exception "errorClass" equals "EXC_BAD_ACCESS"
And the "method" of stack frame 0 equals "objc_msgSend"
And the "method" of stack frame 1 equals one of:
| ARM | __29-[ReleasedObjectScenario run]_block_invoke |
| Intel | -[ReleasedObjectScenario run] |
And the stacktrace contains methods:
| -[ReleasedObjectScenario run] |
And the "isPC" of stack frame 0 is true
And the "isLR" of stack frame 0 is null
And the "isPC" of stack frame 1 is null
Expand Down
Expand Up @@ -4,12 +4,13 @@ class AppHangDidBecomeActiveScenario: Scenario {

override func startBugsnag() {
config.appHangThresholdMillis = 2_000
self.config.autoTrackSessions = false;
super.startBugsnag()
}

override func run() {
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: nil) {
NSLog("Recevied \($0.name), now sleeping for 3 seconds...")
NSLog("Received \($0.name), now sleeping for 3 seconds...")
Thread.sleep(forTimeInterval: 3)
}
}
Expand Down
Expand Up @@ -4,7 +4,7 @@ class AppHangDidEnterBackgroundScenario: Scenario {

override func run() {
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) {
NSLog("Recevied \($0.name), now hanging indefinitely...")
NSLog("Received \($0.name), now hanging indefinitely...")
while true {}
}
}
Expand Down

0 comments on commit 8a692ad

Please sign in to comment.