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

AOT Compiler Crash #52449

Closed
TimWhiting opened this issue May 19, 2023 · 0 comments
Closed

AOT Compiler Crash #52449

TimWhiting opened this issue May 19, 2023 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@TimWhiting
Copy link

Dart SDK version: 3.1.0-128.0.dev (dev) (Thu May 18 23:58:52 2023 -0700) on "linux_x64"

dart compile exe example/scheme.dart 
../../runtime/vm/compiler/backend/il.cc: 3812: error: unreachable code
version=3.1.0-128.0.dev (dev) (Thu May 18 23:58:52 2023 -0700) on "linux_x64"
pid=1007377, thread=-1, isolate_group=isolate(0x55eda953e5c0), isolate=(nil)((nil))
os=linux, arch=x64, comp=no, sim=no
isolate_instructions=0, vm_instructions=0
fp=7ffd7a0b7570, sp=7ffd7a0b7438, pc=55eda7b5be2c
  pc 0x000055eda7b5be2c fp 0x00007ffd7a0b7570 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x37de2c
  pc 0x000055eda7a53f14 fp 0x00007ffd7a0b7650 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x275f14
  pc 0x000055eda7c89dae fp 0x00007ffd7a0b7690 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x4abdae
  pc 0x000055eda7d69ca6 fp 0x00007ffd7a0b76c0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x58bca6
  pc 0x000055eda7d66028 fp 0x00007ffd7a0b7760 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x588028
  pc 0x000055eda7d62fb2 fp 0x00007ffd7a0b7890 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x584fb2
  pc 0x000055eda7d6a360 fp 0x00007ffd7a0b7980 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x58c360
  pc 0x000055eda7c78187 fp 0x00007ffd7a0b7a60 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x49a187
  pc 0x000055eda7c780be fp 0x00007ffd7a0b7a80 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x49a0be
  pc 0x000055eda7c8a8fd fp 0x00007ffd7a0b7ac0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x4ac8fd
  pc 0x000055eda7c76be0 fp 0x00007ffd7a0b7c30 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x498be0
  pc 0x000055eda7c7698f fp 0x00007ffd7a0b7c60 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x49898f
  pc 0x000055eda7d142d0 fp 0x00007ffd7a0b7c70 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x5362d0
  pc 0x000055eda7d13049 fp 0x00007ffd7a0b7cf0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x535049
  pc 0x000055eda7c3d79c fp 0x00007ffd7a0b8350 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x45f79c
  pc 0x000055eda7c3dde5 fp 0x00007ffd7a0b8a10 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x45fde5
  pc 0x000055eda7c3a531 fp 0x00007ffd7a0b8ad0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x45c531
  pc 0x000055eda7c39534 fp 0x00007ffd7a0b8b60 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x45b534
  pc 0x000055eda7c35074 fp 0x00007ffd7a0b8bb0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x457074
  pc 0x000055eda7c32361 fp 0x00007ffd7a0b92b0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x454361
  pc 0x000055eda7c30db8 fp 0x00007ffd7a0b9740 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x452db8
  pc 0x000055eda7dabfc1 fp 0x00007ffd7a0b9860 Dart_Precompile+0x231
  pc 0x000055eda7a4df2c fp 0x00007ffd7a0b99f0 /home/tim/fvm/versions/master/bin/cache/dart-sdk/bin/utils/gen_snapshot+0x26ff2c
-- End of DumpStackTrace
=== Crash occurred when compiling package:syntax/src/scheme/scheme_syntax.dart__$Lambda@25431186_get_formals in AOT mode in GenerateCode pass
=== When compiling block B1[function entry]:2 {
      v2 <- Parameter(0) T{_$Lambda}
}
=== When compiling instruction B1[function entry]:2 {
      v2 <- Parameter(0) T{_$Lambda}
}
*** BEGIN CFG
GenerateCode
==== package:syntax/src/scheme/scheme_syntax.dart__$Lambda@25431186_get_formals (ImplicitGetter)
  0: B0[graph]:0 {
}
  2: B1[function entry]:2 {
      v2 <- Parameter(0) T{_$Lambda}
}
  3:     ParallelMove rcx <- S+1
  4:     v3 <- LoadField(v2 . formals {final}) T{_Record}
  6:     v4 <- LoadField(v3 . :record_field) T{List<SExpr>}
  8:     v5 <- LoadField(v3 . :record_field) T{SExpr??}
 10:     v6 <- MakePair(v4, v5) T{*?}
 12:     Return:4(v6 T{_Record})
*** END CFG
Error: AOT compilation failed
Generating AOT snapshot failed!

The repository is here: https://github.com/TimWhiting/syntax, It involves an ImplicitGetter with a record return type.

I tried simplifying the relevant code as follows, but this doesn't trigger the crash.

sealed class Test {
  Test._();
  factory Test.a(Formals formals) = TestA;
}

sealed class ITest {}

sealed class ITest2 extends ITest {
  Formals get params;
}

typedef Formals = (List<String>, String?);

abstract class TestA extends Test implements ITest2 {
  TestA._() : super._();
  @override
  (List<String>, String?) get params;
  factory TestA(final (List<String>, String?) p) = TestImpl;
}

class TestImpl extends TestA {
  @override
  final (List<String>, String?) params;

  TestImpl(this.params) : super._();
}

void main() {
  final test = TestImpl((['a', 'b'], null));
  print(test.params);
}
@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label May 19, 2023
@alexmarkov alexmarkov self-assigned this May 19, 2023
copybara-service bot pushed a commit that referenced this issue May 24, 2023
…unboxed record return values

Unboxing of records involves a more complex code, and such intrinsics
would be similar to the normal code of the implicit getters.

TEST=runtime/tests/vm/dart/regress_52449_test.dart

Bug: #52449
Change-Id: Ic6b4ca21609921f0215275be6578f6bbc1fe3eeb
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/304282
Fixes: #52467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304760
Commit-Queue: Alexander Markov <[email protected]>
Reviewed-by: Siva Annamalai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

3 participants