Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of callStackSymbols where the image name contains spaces #1036

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bugsnag/Payload/BugsnagStackframe.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ + (BugsnagStackframe *)frameFromDict:(NSDictionary *)dict
+ (NSArray<BugsnagStackframe *> *)stackframesWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
NSString *pattern = (@"^(\\d+)" // Capture the leading frame number
@" +" // Skip whitespace
@"(\\S+)" // Image name
@"([\\S ]+?)" // Image name (may contain spaces)
@" +" // Skip whitespace
@"(0x[0-9a-fA-F]+)" // Capture the frame address
@"(" // Start optional group
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## TBD

### Bug fixes

* Fix parsing of `callStackSymbols` where the image name contains spaces.
[#1036](https://github.com/bugsnag/bugsnag-cocoa/pull/1036)

## 6.7.1 (2021-03-10)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions Tests/BugsnagStackframeTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ - (void)testDummyCallStackSymbols {
@"4 CoreFoundation 0x00007fff23e41fd1",
@"5 CoreFoundation 0x00007fff23e422a4",
@"6 ReactNativeTest 0x000000010fd76eae",
@"7 ReactNativeTest 0x000000010fd79138"]];
@"7 ReactNative App 0x000000010fd79138"]];

AssertStackframeValues(stackframes[0], @"ReactNativeTest", 0x000000010fda7f1b, @"0x000000010fda7f1b");
AssertStackframeValues(stackframes[1], @"ReactNativeTest", 0x000000010fd76897, @"0x000000010fd76897");
Expand All @@ -179,7 +179,7 @@ - (void)testDummyCallStackSymbols {
AssertStackframeValues(stackframes[4], @"CoreFoundation", 0x00007fff23e41fd1, @"0x00007fff23e41fd1");
AssertStackframeValues(stackframes[5], @"CoreFoundation", 0x00007fff23e422a4, @"0x00007fff23e422a4");
AssertStackframeValues(stackframes[6], @"ReactNativeTest", 0x000000010fd76eae, @"0x000000010fd76eae");
AssertStackframeValues(stackframes[7], @"ReactNativeTest", 0x000000010fd79138, @"0x000000010fd79138");
AssertStackframeValues(stackframes[7], @"ReactNative App", 0x000000010fd79138, @"0x000000010fd79138");
}

- (void)testRealCallStackSymbols {
Expand Down