Skip to content

[dart2wasm] co19/LanguageFeatures/Extension-types/static_analysis_member_invocation_A05_t03 crashes compiler #53239

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

Closed
sgrekhov opened this issue Aug 16, 2023 · 2 comments
Assignees
Labels
area-dart2wasm Issues for the dart2wasm compiler. cfe-feature-extension-types Implement extension types feature in the CFE crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.

Comments

@sgrekhov
Copy link
Contributor

Test https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Extension-types/dynamic_semantics_extension_type_A05_t03.dart crashes the compiler

Failure log:


/==========================================================================================================================\
| co19/LanguageFeatures/Extension-types/static_analysis_member_invocation_A05_t03 is new and failed (Crash, expected Pass) |
\==========================================================================================================================/

--- Command "dart2wasm" (took 01.000383s):
DART_CONFIGURATION=ReleaseX64 CHROME_PATH=/b/s/w/ir/third_party/browsers/chrome/chrome/google-chrome sdk/bin/dart2wasm_developer -Dtest_runner.configuration=dart2wasm-linux-chrome --enable-experiment=inline-class /b/s/w/ir/tests/co19/src/LanguageFeatures/Extension-types/static_analysis_member_invocation_A05_t03.dart /b/s/w/ir/out/ReleaseX64/generated_tests/dart2wasm-linux-chrome/tests_co19_src_LanguageFeatures_Extension-types_static_analysis_member_invocation_A05_t03/static_analysis_member_invocation_A05_t03.wasm

exit code:
255

stderr:
Unhandled exception:
Null check operator used on a null value
#0      _ClosureTrampolineGenerator.generate (package:dart2wasm/translator.dart:1052)
#1      Translator.translate (package:dart2wasm/translator.dart:360)
#2      compileToModule (package:dart2wasm/compile.dart:138)
<asynchronous suspension>
#3      main (package:dart2wasm/dart2wasm.dart:134)
<asynchronous suspension>
#4      main (file:///b/s/w/ir/cache/builder/sdk/pkg/dart2wasm/bin/dart2wasm.dart:7)
<asynchronous suspension>

--- Re-run this test:
python3 tools/test.py -n dart2wasm-linux-chrome co19/LanguageFeatures/Extension-types/static_analysis_member_invocation_A05_t03

@sgrekhov sgrekhov added crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. area-dart2wasm Issues for the dart2wasm compiler. labels Aug 16, 2023
@osa1 osa1 self-assigned this Dec 11, 2023
@osa1
Copy link
Member

osa1 commented Dec 11, 2023

I think this is a CFE bug, the tear-off member generated by CFE is missing the optional parameter's default value. Smaller repro:

extension type ET1(int id) {
  ET1.n1(this.id, [String s = ""]);
}

main() {
  var x = ET1.n1;
}

Kernel before TFA for ET1.n1 tear-off member is missing the default value:

  static extension-type-member method ET1|constructor#_#n1#tearOff(core::int id, [has-declared-initializer core::String s]) → test::ET1 /* = core::int */
    return test::ET1|constructor#n1(id, s);

s is missing the default value, it should looks like [core::String s = #C1].

@johnniwinther could you take a look?

@johnniwinther johnniwinther added the cfe-feature-extension-types Implement extension types feature in the CFE label Dec 11, 2023
@johnniwinther
Copy link
Member

This looks like a CFE bug. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart2wasm Issues for the dart2wasm compiler. cfe-feature-extension-types Implement extension types feature in the CFE crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.
Projects
None yet
Development

No branches or pull requests

3 participants