Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chinmaygarde
Copy link
Member

This is similar to how we recommend users attach uncaught exception handlers in their code for reporting purposes. The same limitations as that approach apply here as well.

@chinmaygarde
Copy link
Member Author

xref FL-154

// ignore: unused_element
void _runMainZoned(Function startMainIsolateFunction, Function userMainFunction) {
startMainIsolateFunction((){
runZoned<Future<void>>(() async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this closure need to be async?
runZoned(() { ... ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patched.

Copy link
Contributor

@rmacnak-google rmacnak-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

FML_LOG(ERROR) << "Could not resolve main entrypoint trampolines.";
return false;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could invoke runMainZoned directly instead of closurizing first. Instead of

Dart_Invoke(Dart_GetField(dart:ui, "_runMainZoned"), a, b)

do

Dart_Invoke(dart:ui, "_runMainZoned", a, b)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was attempting to use the tonic wrappers for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused breakage: note that @pragma('vm:entry-point') does not permit closurization of the static methods - it only permits invocation. Thus AOT compiler retained _runMainZoned but not get:_runMainZoned which is necessary for closurization. This subsequently crashes in AOT mode because runtime can't create get:_runMainZoned dynamically.

I am going to revert this PR for now to unbreak the engine.

I have also bumped priority of dart-lang/sdk#35369 - which should catch this sort of issues in the JIT mode as well, not just in AOT mode.

/cc @sjindel-google

@chinmaygarde chinmaygarde merged commit 25559ed into flutter:master Jan 17, 2019
@chinmaygarde chinmaygarde deleted the runtests branch January 17, 2019 00:08
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jan 17, 2019
flutter/engine@3c0aa91...25559ed

git log 3c0aa91..25559ed --no-merges --oneline
25559ed Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)
1b0d09b Roll src/third_party/dart f701e11756..700254996f (5 commits) 700254996f [ Observatory / Dartium ] Updated observatory documentation and tests to remove references to Dartium. 78abb98ee7 [vm/bytecode] Fix AST removal for package-split kernel files with bytecode 0075b58bb8 CHANGELOG entry for DEPRECATED_MEMBER_USE split a5f102a7d1 Analyzer: first pass at reporting unchecked nullable value usage. a10ddca1b1 [ VM / Service ] Allow for `profile_period` flag to be set via the service protocol
e7ade51 Remove unused headers (flutter/engine#7511)
369b4db Roll src/third_party/skia 1374c85fbf53..081e6f375497 (6 commits) (flutter/engine#7510)
366d44e Roll src/third_party/dart 9b5eabdaca..f701e11756 (10 commits) f701e11756 [ VM / Debugger ] Fix issue where a &#39;Step&#39; command issued when there&#39;s no stack caused a crash. c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally dbeec3bbf3 Fix formatting in generated LSP file header bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris 7984dc4fcc Prepare to publish analyzer version 0.34.2. 4b1b2f9176 Switch LSP formatter to not fetch resolved ASTs that aren&#39;t used 5ce5d697da Implement LSP code folding b47524d5b0 Ensure all unhandled exceptions are recorded on the server 8ba2de2344 Sort context for conflicting inherited members 215f6620e7 [Kernel] Signal errors on static fields in constant contexts
1e93a8e Deprecate FlutterProjectArgs.main_path, packages_path (flutter/engine#7497)
b058920 Edit the bundleid so that it conform to UIT specifications. (flutter/engine#7503)
32c9ae6 Roll src/third_party/skia 2c379d8e27e6..1374c85fbf53 (4 commits) (flutter/engine#7508)
96d10b1 Roll src/third_party/dart 492df72739..9b5eabdaca (8 commits) 9b5eabdaca Fix crash in color support a533753bec Remove --fast-startup flag support from testing scripts and status files 5f10aed19c [Kernel] Don&#39;t print static fields in instance constants bdb51e2837 Improve input path handling and remove extra schemas. 0604110806 Reduce expectations on thrown exception 966e007b63 Pass CallStructure on dynamic and static use in ResolutionWorldBuilder 3e7801294e Remove unneeded code in OrderedTypeSet 8a91948c03 [Kernel] Properly signal compilation errors for constants
7709840 Roll src/third_party/skia a8694cc150a1..2c379d8e27e6 (1 commits) (flutter/engine#7506)
046ddc6 Roll src/third_party/skia 47b7cd9a6baf..a8694cc150a1 (1 commits) (flutter/engine#7504)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
mraleph added a commit to mraleph/engine that referenced this pull request Jan 17, 2019
…tion callback. (flutter#7512)"

This reverts commit 25559ed.

Reason for revert: broken in AOT mode.

@pragma('vm:entry-point') placed on a function only instructs
the compiler to retain the function itself, but does not tell
compiler to generate and retain tear-off for this function.

In this PR _runMainZoned was marked as an entry-point but C++
code was trying to tear it off and use a closure, instead of
invoking it directly, which is not supported.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
mraleph added a commit that referenced this pull request Jan 17, 2019
…tion callback. (#7512)" (#7522)

This reverts commit 25559ed.

Reason for revert: broken in AOT mode.

@pragma('vm:entry-point') placed on a function only instructs
the compiler to retain the function itself, but does not tell
compiler to generate and retain tear-off for this function.

In this PR _runMainZoned was marked as an entry-point but C++
code was trying to tear it off and use a closure, instead of
invoking it directly, which is not supported.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 17, 2019
dnfield added a commit to flutter/flutter that referenced this pull request Jan 17, 2019
d470fc6 Roll src/third_party/skia 31972f889641..57263c2e0ccd (3 commits) (flutter/engine#7529)
4acfced Ensure the ResourceContext is not ripped out from under dart (flutter/engine#7528)
270e9a7 Roll src/third_party/skia a4e46804946c..31972f889641 (8 commits) (flutter/engine#7526)
e984372 Roll src/third_party/skia 33b4b4908b7a..a4e46804946c (1 commits) (flutter/engine#7524)
4c135c2 Revert "Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)" (flutter/engine#7522)
0a080a1 Roll src/third_party/dart 700254996f..da09945643 (14 commits) da09945643 Update dartfix pubspec before publishing b81c1b2095 Parse spread collections in map literals 1b0d93366d Add list literal spread collection fasta test cases 6c2ea4936a Clean up several deprecation hints 07f95e7761 Revert "[vm] Enable timeline on Fuchsia even in product mode." 9cdce03e16 [dart2js] Improve null receiver guard removal near JS code c3599a9d8c Revert "[vm, isolate] Fix length truncation in message snapshots." 95e10c336f Revert "[vm] Assert callback state for all Dart_Set*ReturnValue." 3f7b371f2c [vm] Enable timeline on Fuchsia even in product mode. 4b22195ea1 [vm, isolate] Fix length truncation in message snapshots. a353b1172a [vm, compiler] Remove TAG_IC_DATA, which has since been subsumed by RebindRule. ca12afec50 [vm] Assert callback state for all Dart_Set*ReturnValue. 2028006a25 [Observatory] Updated Dart icon to new colour scheme 84273b9f36 Improvements for flow analysis.
fff5377 Roll src/third_party/skia 25b9f192ed8c..33b4b4908b7a (1 commits) (flutter/engine#7520)
a58cc39 Roll src/third_party/skia 1ce80fb351a2..25b9f192ed8c (5 commits) (flutter/engine#7517)
52e0e9d Roll src/third_party/skia 081e6f375497..1ce80fb351a2 (12 commits) (flutter/engine#7514)
25559ed Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)
1b0d09b Roll src/third_party/dart f701e11756..700254996f (5 commits) 700254996f [ Observatory / Dartium ] Updated observatory documentation and tests to remove references to Dartium. 78abb98ee7 [vm/bytecode] Fix AST removal for package-split kernel files with bytecode 0075b58bb8 CHANGELOG entry for DEPRECATED_MEMBER_USE split a5f102a7d1 Analyzer: first pass at reporting unchecked nullable value usage. a10ddca1b1 [ VM / Service ] Allow for `profile_period` flag to be set via the service protocol
e7ade51 Remove unused headers (flutter/engine#7511)
369b4db Roll src/third_party/skia 1374c85fbf53..081e6f375497 (6 commits) (flutter/engine#7510)
366d44e Roll src/third_party/dart 9b5eabdaca..f701e11756 (10 commits) f701e11756 [ VM / Debugger ] Fix issue where a 'Step' command issued when there's no stack caused a crash. c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally dbeec3bbf3 Fix formatting in generated LSP file header bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris 7984dc4fcc Prepare to publish analyzer version 0.34.2. 4b1b2f9176 Switch LSP formatter to not fetch resolved ASTs that aren't used 5ce5d697da Implement LSP code folding b47524d5b0 Ensure all unhandled exceptions are recorded on the server 8ba2de2344 Sort context for conflicting inherited members 215f6620e7 [Kernel] Signal errors on static fields in constant contexts
dnfield added a commit to flutter/flutter that referenced this pull request Jan 18, 2019
* Roll engine to d470fc6

d470fc6 Roll src/third_party/skia 31972f889641..57263c2e0ccd (3 commits) (flutter/engine#7529)
4acfced Ensure the ResourceContext is not ripped out from under dart (flutter/engine#7528)
270e9a7 Roll src/third_party/skia a4e46804946c..31972f889641 (8 commits) (flutter/engine#7526)
e984372 Roll src/third_party/skia 33b4b4908b7a..a4e46804946c (1 commits) (flutter/engine#7524)
4c135c2 Revert "Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)" (flutter/engine#7522)
0a080a1 Roll src/third_party/dart 700254996f..da09945643 (14 commits) da09945643 Update dartfix pubspec before publishing b81c1b2095 Parse spread collections in map literals 1b0d93366d Add list literal spread collection fasta test cases 6c2ea4936a Clean up several deprecation hints 07f95e7761 Revert "[vm] Enable timeline on Fuchsia even in product mode." 9cdce03e16 [dart2js] Improve null receiver guard removal near JS code c3599a9d8c Revert "[vm, isolate] Fix length truncation in message snapshots." 95e10c336f Revert "[vm] Assert callback state for all Dart_Set*ReturnValue." 3f7b371f2c [vm] Enable timeline on Fuchsia even in product mode. 4b22195ea1 [vm, isolate] Fix length truncation in message snapshots. a353b1172a [vm, compiler] Remove TAG_IC_DATA, which has since been subsumed by RebindRule. ca12afec50 [vm] Assert callback state for all Dart_Set*ReturnValue. 2028006a25 [Observatory] Updated Dart icon to new colour scheme 84273b9f36 Improvements for flow analysis.
fff5377 Roll src/third_party/skia 25b9f192ed8c..33b4b4908b7a (1 commits) (flutter/engine#7520)
a58cc39 Roll src/third_party/skia 1ce80fb351a2..25b9f192ed8c (5 commits) (flutter/engine#7517)
52e0e9d Roll src/third_party/skia 081e6f375497..1ce80fb351a2 (12 commits) (flutter/engine#7514)
25559ed Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)
1b0d09b Roll src/third_party/dart f701e11756..700254996f (5 commits) 700254996f [ Observatory / Dartium ] Updated observatory documentation and tests to remove references to Dartium. 78abb98ee7 [vm/bytecode] Fix AST removal for package-split kernel files with bytecode 0075b58bb8 CHANGELOG entry for DEPRECATED_MEMBER_USE split a5f102a7d1 Analyzer: first pass at reporting unchecked nullable value usage. a10ddca1b1 [ VM / Service ] Allow for `profile_period` flag to be set via the service protocol
e7ade51 Remove unused headers (flutter/engine#7511)
369b4db Roll src/third_party/skia 1374c85fbf53..081e6f375497 (6 commits) (flutter/engine#7510)
366d44e Roll src/third_party/dart 9b5eabdaca..f701e11756 (10 commits) f701e11756 [ VM / Debugger ] Fix issue where a 'Step' command issued when there's no stack caused a crash. c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally dbeec3bbf3 Fix formatting in generated LSP file header bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris 7984dc4fcc Prepare to publish analyzer version 0.34.2. 4b1b2f9176 Switch LSP formatter to not fetch resolved ASTs that aren't used 5ce5d697da Implement LSP code folding b47524d5b0 Ensure all unhandled exceptions are recorded on the server 8ba2de2344 Sort context for conflicting inherited members 215f6620e7 [Kernel] Signal errors on static fields in constant contexts
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 18, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 18, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 18, 2019
chinmaygarde added a commit to chinmaygarde/flutter_engine that referenced this pull request Jan 23, 2019
…ption callback. (flutter#7512)"

This reverts commit 4c135c2 and applies relevant fixes.
chinmaygarde added a commit to chinmaygarde/flutter_engine that referenced this pull request Jan 24, 2019
…ption callback. (flutter#7512)"

This reverts commit 4c135c2 and applies relevant fixes.
chinmaygarde added a commit to chinmaygarde/flutter_engine that referenced this pull request Jan 24, 2019
…ption callback. (flutter#7512)"

This reverts commit 4c135c2 and applies relevant fixes.
chinmaygarde added a commit that referenced this pull request Jan 24, 2019
…ption callback. (#7512)" (#7551)

This reverts commit 4c135c2 and applies relevant fixes.
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
flutter/engine@3c0aa91...25559ed

git log 3c0aa91..25559ed --no-merges --oneline
25559ed Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)
1b0d09b Roll src/third_party/dart f701e11756..700254996f (5 commits) 700254996f [ Observatory / Dartium ] Updated observatory documentation and tests to remove references to Dartium. 78abb98ee7 [vm/bytecode] Fix AST removal for package-split kernel files with bytecode 0075b58bb8 CHANGELOG entry for DEPRECATED_MEMBER_USE split a5f102a7d1 Analyzer: first pass at reporting unchecked nullable value usage. a10ddca1b1 [ VM / Service ] Allow for `profile_period` flag to be set via the service protocol
e7ade51 Remove unused headers (flutter/engine#7511)
369b4db Roll src/third_party/skia 1374c85fbf53..081e6f375497 (6 commits) (flutter/engine#7510)
366d44e Roll src/third_party/dart 9b5eabdaca..f701e11756 (10 commits) f701e11756 [ VM / Debugger ] Fix issue where a &flutter#39;Step&flutter#39; command issued when there&flutter#39;s no stack caused a crash. c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally dbeec3bbf3 Fix formatting in generated LSP file header bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris 7984dc4fcc Prepare to publish analyzer version 0.34.2. 4b1b2f9176 Switch LSP formatter to not fetch resolved ASTs that aren&flutter#39;t used 5ce5d697da Implement LSP code folding b47524d5b0 Ensure all unhandled exceptions are recorded on the server 8ba2de2344 Sort context for conflicting inherited members 215f6620e7 [Kernel] Signal errors on static fields in constant contexts
1e93a8e Deprecate FlutterProjectArgs.main_path, packages_path (flutter/engine#7497)
b058920 Edit the bundleid so that it conform to UIT specifications. (flutter/engine#7503)
32c9ae6 Roll src/third_party/skia 2c379d8e27e6..1374c85fbf53 (4 commits) (flutter/engine#7508)
96d10b1 Roll src/third_party/dart 492df72739..9b5eabdaca (8 commits) 9b5eabdaca Fix crash in color support a533753bec Remove --fast-startup flag support from testing scripts and status files 5f10aed19c [Kernel] Don&flutter#39;t print static fields in instance constants bdb51e2837 Improve input path handling and remove extra schemas. 0604110806 Reduce expectations on thrown exception 966e007b63 Pass CallStructure on dynamic and static use in ResolutionWorldBuilder 3e7801294e Remove unneeded code in OrderedTypeSet 8a91948c03 [Kernel] Properly signal compilation errors for constants
7709840 Roll src/third_party/skia a8694cc150a1..2c379d8e27e6 (1 commits) (flutter/engine#7506)
046ddc6 Roll src/third_party/skia 47b7cd9a6baf..a8694cc150a1 (1 commits) (flutter/engine#7504)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
* Roll engine to d470fc6

d470fc6 Roll src/third_party/skia 31972f889641..57263c2e0ccd (3 commits) (flutter/engine#7529)
4acfced Ensure the ResourceContext is not ripped out from under dart (flutter/engine#7528)
270e9a7 Roll src/third_party/skia a4e46804946c..31972f889641 (8 commits) (flutter/engine#7526)
e984372 Roll src/third_party/skia 33b4b4908b7a..a4e46804946c (1 commits) (flutter/engine#7524)
4c135c2 Revert "Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)" (flutter/engine#7522)
0a080a1 Roll src/third_party/dart 700254996f..da09945643 (14 commits) da09945643 Update dartfix pubspec before publishing b81c1b2095 Parse spread collections in map literals 1b0d93366d Add list literal spread collection fasta test cases 6c2ea4936a Clean up several deprecation hints 07f95e7761 Revert "[vm] Enable timeline on Fuchsia even in product mode." 9cdce03e16 [dart2js] Improve null receiver guard removal near JS code c3599a9d8c Revert "[vm, isolate] Fix length truncation in message snapshots." 95e10c336f Revert "[vm] Assert callback state for all Dart_Set*ReturnValue." 3f7b371f2c [vm] Enable timeline on Fuchsia even in product mode. 4b22195ea1 [vm, isolate] Fix length truncation in message snapshots. a353b1172a [vm, compiler] Remove TAG_IC_DATA, which has since been subsumed by RebindRule. ca12afec50 [vm] Assert callback state for all Dart_Set*ReturnValue. 2028006a25 [Observatory] Updated Dart icon to new colour scheme 84273b9f36 Improvements for flow analysis.
fff5377 Roll src/third_party/skia 25b9f192ed8c..33b4b4908b7a (1 commits) (flutter/engine#7520)
a58cc39 Roll src/third_party/skia 1ce80fb351a2..25b9f192ed8c (5 commits) (flutter/engine#7517)
52e0e9d Roll src/third_party/skia 081e6f375497..1ce80fb351a2 (12 commits) (flutter/engine#7514)
25559ed Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512)
1b0d09b Roll src/third_party/dart f701e11756..700254996f (5 commits) 700254996f [ Observatory / Dartium ] Updated observatory documentation and tests to remove references to Dartium. 78abb98ee7 [vm/bytecode] Fix AST removal for package-split kernel files with bytecode 0075b58bb8 CHANGELOG entry for DEPRECATED_MEMBER_USE split a5f102a7d1 Analyzer: first pass at reporting unchecked nullable value usage. a10ddca1b1 [ VM / Service ] Allow for `profile_period` flag to be set via the service protocol
e7ade51 Remove unused headers (flutter/engine#7511)
369b4db Roll src/third_party/skia 1374c85fbf53..081e6f375497 (6 commits) (flutter/engine#7510)
366d44e Roll src/third_party/dart 9b5eabdaca..f701e11756 (10 commits) f701e11756 [ VM / Debugger ] Fix issue where a 'Step' command issued when there's no stack caused a crash. c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally dbeec3bbf3 Fix formatting in generated LSP file header bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris 7984dc4fcc Prepare to publish analyzer version 0.34.2. 4b1b2f9176 Switch LSP formatter to not fetch resolved ASTs that aren't used 5ce5d697da Implement LSP code folding b47524d5b0 Ensure all unhandled exceptions are recorded on the server 8ba2de2344 Sort context for conflicting inherited members 215f6620e7 [Kernel] Signal errors on static fields in constant contexts
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants