[native_stack_traces] Remove initial spaces check in stack trace lines.

The strictness of the old "check for four spaces" was causing failures
in `flutter symbolize`, and there's no reason to check how much initial
whitespace we got prior to the line contents anyway.

TEST=pkg/native_stack_traces/test/convert/regress_262474517_test

Change-Id: I6a6e31732cb2a5b5d40a088b9a04877052726be2
Bug: b/262474517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276905
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
This commit is contained in:
Tess Strickland
2022-12-21 12:47:54 +00:00
committed by Commit Queue
parent 0c87c84bf3
commit ae4ee87601
5 changed files with 48 additions and 4 deletions
+4
View File
@@ -1,3 +1,7 @@
## 0.5.4
- Relaxed requirement for spaces before non-symbolic stack trace line.
## 0.5.3
- Exported more ELF utilities for use in Dart tests.
+3 -3
View File
@@ -125,9 +125,9 @@ const _symbolOffsetREString = r'(?<symbol>' +
constants.isolateSymbolName +
r')\+(?<offset>(?:0x)?[\da-f]+)';
final _symbolOffsetRE = RegExp(_symbolOffsetREString);
final _traceLineRE = RegExp(
r' #(\d+) abs (?<absolute>[\da-f]+)(?: virt (?<virtual>[\da-f]+))? '
r'(?<rest>.*)$');
final _traceLineRE =
RegExp(r'#(\d+) abs (?<absolute>[\da-f]+)(?: virt (?<virtual>[\da-f]+))? '
r'(?<rest>.*)$');
/// Parses strings of the format <static symbol>+<integer offset>, where
/// <static symbol> is one of the static symbols used for Dart instruction
+2 -1
View File
@@ -1,5 +1,5 @@
name: native_stack_traces
version: 0.5.3
version: 0.5.4
description: Utilities for working with non-symbolic stack traces.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/native_stack_traces
@@ -19,3 +19,4 @@ dependencies:
# See also https://dart.dev/tools/pub/dependencies.
dev_dependencies:
lints: any
test: any
@@ -0,0 +1,33 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:native_stack_traces/src/convert.dart';
import 'package:native_stack_traces/src/dwarf.dart';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
void main() {
group('convert tests', defineConvertTests);
}
final String pkgDir = Platform.script.resolve('../..').toFilePath();
void defineConvertTests() {
test('b/262474517 regression', () async {
final inputPath = path.join(
pkgDir, 'testcases', 'convert', 'regress_262474517_trace.txt');
final contents = await File(inputPath).readAsLines();
final pcOffsets = collectPCOffsets(contents);
expect(pcOffsets.map((o) => o.offset).toList(),
[0x14e87f, 0x2a4e27, 0x4ee12b, 0x477fc7]);
expect(pcOffsets.map((o) => o.section).toList(), [
InstructionsSection.isolate,
InstructionsSection.isolate,
InstructionsSection.isolate,
InstructionsSection.isolate
]);
});
}
@@ -0,0 +1,6 @@
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: No element. Error thrown null.
BuildId: c3126a4381294e13185549e5e94a4db9
at . #00 abs 0 virt 000000000031ba6f _kDartIsolateSnapshotInstructions+0x14e87f
at . #01 abs 0 virt 0000000000472017 _kDartIsolateSnapshotInstructions+0x2a4e27
at . #02 abs 0 virt 00000000006bb31b _kDartIsolateSnapshotInstructions+0x4ee12b
at . #03 abs 0 virt 00000000006451b7 _kDartIsolateSnapshotInstructions+0x477fc7