Skip to content

Commit 978b838

Browse files
michaltcommit-bot@chromium.org
authored andcommitted
Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 8f2c47f. Reason for revert: We suspect this is causing VM crashes: http://b/177506826 Original change's description: > [VM] Adds Future.then and Future.catchError stack unwinding. > > TEST=Various 'causal' tests updated below. > > Bug: #40815, #37953 > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662 > Commit-Queue: Clement Skau <[email protected]> > Reviewed-by: Vyacheslav Egorov <[email protected]> [email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: #40815 Bug: #37953 Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998 Reviewed-by: Michal Terepeta <[email protected]> Reviewed-by: Vyacheslav Egorov <[email protected]> Commit-Queue: Michal Terepeta <[email protected]>
1 parent f93cf84 commit 978b838

File tree

15 files changed

+926
-1497
lines changed

15 files changed

+926
-1497
lines changed

pkg/vm_service/test/get_stack_test.dart

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ final tests = <IsolateTest>[
5252
// Before the first await.
5353
hasStoppedAtBreakpoint,
5454
stoppedAtLine(LINE_A),
55-
// At LINE_A we're still running sync. so no asyncCausalFrames.
5655
(VmService service, IsolateRef isolateRef) async {
5756
final result = await service.getStack(isolateRef.id);
5857

5958
expect(result.frames, hasLength(16));
60-
expect(result.asyncCausalFrames, isNull);
59+
expect(result.asyncCausalFrames, hasLength(16));
6160
expect(result.awaiterFrames, hasLength(16));
6261

6362
expectFrames(result.frames, [
@@ -74,6 +73,20 @@ final tests = <IsolateTest>[
7473
[equals('Regular'), endsWith(' testMain')],
7574
]);
7675

76+
expectFrames(result.asyncCausalFrames, [
77+
[equals('Regular'), endsWith(' func10')],
78+
[equals('Regular'), endsWith(' func9')],
79+
[equals('Regular'), endsWith(' func8')],
80+
[equals('Regular'), endsWith(' func7')],
81+
[equals('Regular'), endsWith(' func6')],
82+
[equals('Regular'), endsWith(' func5')],
83+
[equals('Regular'), endsWith(' func4')],
84+
[equals('Regular'), endsWith(' func3')],
85+
[equals('Regular'), endsWith(' func2')],
86+
[equals('Regular'), endsWith(' func1')],
87+
[equals('Regular'), endsWith(' testMain')],
88+
]);
89+
7790
expectFrames(result.awaiterFrames, [
7891
[equals('AsyncActivation'), endsWith(' func10')],
7992
[equals('AsyncActivation'), endsWith(' func9')],
@@ -88,10 +101,10 @@ final tests = <IsolateTest>[
88101
[equals('AsyncActivation'), endsWith(' testMain')],
89102
]);
90103
},
104+
// After resuming the continuation - i.e. running async.
91105
resumeIsolate,
92106
hasStoppedAtBreakpoint,
93107
stoppedAtLine(LINE_B),
94-
// After resuming the continuation - i.e. running async.
95108
(VmService service, IsolateRef isolateRef) async {
96109
final result = await service.getStack(isolateRef.id);
97110

runtime/observatory/tests/service/causal_async_stack_presence_test.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ import 'service_test_common.dart';
1111
import 'test_helper.dart';
1212

1313
const LINE_C = 19;
14-
const LINE_A = 25;
15-
const LINE_B = 31;
14+
const LINE_A = 24;
15+
const LINE_B = 30;
1616

1717
foobar() {
1818
debugger();
1919
print('foobar'); // LINE_C.
2020
}
2121

2222
helper() async {
23-
await 0; // Yield. The rest will run async.
2423
debugger();
2524
print('helper'); // LINE_A.
2625
foobar();
@@ -37,15 +36,14 @@ var tests = <IsolateTest>[
3736
(Isolate isolate) async {
3837
ServiceMap stack = await isolate.getStack();
3938
// No causal frames because we are in a completely synchronous stack.
40-
// Async function hasn't yielded yet.
4139
expect(stack['asyncCausalFrames'], isNull);
4240
},
4341
resumeIsolate,
4442
hasStoppedAtBreakpoint,
4543
stoppedAtLine(LINE_A),
4644
(Isolate isolate) async {
4745
ServiceMap stack = await isolate.getStack();
48-
// Async function has yielded once, so it's now running async.
46+
// Has causal frames (we are inside an async function)
4947
expect(stack['asyncCausalFrames'], isNotNull);
5048
},
5149
resumeIsolate,

runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var tests = <IsolateTest>[
3939
(Isolate isolate) async {
4040
ServiceMap stack = await isolate.getStack();
4141
// No causal frames because we are in a completely synchronous stack.
42-
expect(stack['asyncCausalFrames'], isNull);
42+
expect(stack['asyncCausalFrames'], isNotNull);
4343
},
4444
resumeIsolate,
4545
hasStoppedAtBreakpoint,

runtime/observatory_2/tests/service_2/causal_async_stack_presence_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ import 'service_test_common.dart';
1111
import 'test_helper.dart';
1212

1313
const LINE_C = 19;
14-
const LINE_A = 25;
15-
const LINE_B = 31;
14+
const LINE_A = 24;
15+
const LINE_B = 30;
1616

1717
foobar() {
1818
debugger();
1919
print('foobar'); // LINE_C.
2020
}
2121

2222
helper() async {
23-
await 0; // Yield. The rest will run async.
2423
debugger();
2524
print('helper'); // LINE_A.
2625
foobar();

runtime/observatory_2/tests/service_2/causal_async_star_stack_presence_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var tests = <IsolateTest>[
3939
(Isolate isolate) async {
4040
ServiceMap stack = await isolate.getStack();
4141
// No causal frames because we are in a completely synchronous stack.
42-
expect(stack['asyncCausalFrames'], isNull);
42+
expect(stack['asyncCausalFrames'], isNotNull);
4343
},
4444
resumeIsolate,
4545
hasStoppedAtBreakpoint,

0 commit comments

Comments
 (0)