Dart snapshot generator failed with exit code -6, .../aot/precompiler.cc: 2789: unreachable code

292 views
Skip to first unread message

Hugo van Galen

unread,
Mar 23, 2018, 10:03:21 AM3/23/18
to Flutter Dev
I'm using the master branch (it contains a fix for slow startups on Android with lots of assets), and recently I am running into the following error while building:

[+14098 ms] ../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 2789: error: unreachable code
[        ] Dart snapshot generator failed with exit code -6
[   +1 ms] ../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 2789: error: unreachable code
[  +18 ms] "flutter aot" took 30,505ms.

I wonder how I can figure out what is causing this exact issue (other than to dissect the project and slowly piece things together again).

Thanks in advance for any hints.


BTW, peaking inside the called `gen_snapshot` binary hinted there is a `--verbose_debug` switch. Not sure how that is supposed to be used, but I ran it with that and then it core dumped:

$ /path/to/gen_snapshot --verbose_debug --await_is_keyword --
vm_snapshot_data=build/aot/vm_snapshot_data --isolate_snapshot_data=build/aot/isolate_snapshot_data --packages=.packages --url_mapping=dart:ui,/data/development/git/flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart --url_mapping=dart:vmservice_io,/data/development/git/flutter/bin/cache/pkg/sky_engine/sdk_ext/vmservice_io.dart --print_snapshot_sizes --dependencies=build/aot/snapshot.d --causal_async_stacks --embedder_entry_points_manifest=/data/development/git/flutter/bin/cache/artifacts/engine/android-arm-release/dart_vm_entry_points.txt --embedder_entry_points_manifest=/data/development/git/flutter/bin/cache/artifacts/engine/android-arm-release/dart_io_entries.txt --snapshot_kind=app-aot-blobs --vm_snapshot_instructions=build/aot/vm_snapshot_instr --isolate_snapshot_instructions=build/aot/isolate_snapshot_instr --no-sim-use-hardfp --no-use-integer-division --reify-generic-functions --strong build/app.dill  
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 2789: error: unreachable code
Aborted (core dumped)

FWIW:

#0  0xf76e4be9 in __kernel_vsyscall ()
#1  0xf730dea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf730f407 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x004cec5b in ?? ()
#4  0x0073e61d in ?? ()
#5  0x005c384d in ?? ()
#6  0x005c6633 in ?? ()
#7  0x005bf8cc in ?? ()
#8  0x005b9077 in ?? ()
#9  0x005b68a5 in ?? ()
#10 0x005b66d7 in ?? ()
#11 0x00729df6 in ?? ()
#12 0x003411a0 in ?? ()
#13 0x0033fad6 in ?? ()
#14 0x003415c4 in ?? ()
#15 0xf72fa637 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
#16 0x0033c021 in ?? ()

Chris Bracken

unread,
Mar 23, 2018, 12:48:23 PM3/23/18
to hugova...@gmail.com, Flutter Dev
Thanks for reporting this!

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

veg...@google.com

unread,
Mar 23, 2018, 12:50:20 PM3/23/18
to Flutter Dev
Hi Hugo,

In general we would need a reproduction for the crash to be able to diagnose it. 

If your application is not open-source then we should try to figure it out based on some additional tracing.

Can you run gen_snapshot with --trace-compiler? That should allow us to zero on the function that is being miscompiled.

Once you have that we can try to extract the part that is causing a problem. 

Hugo van Galen

unread,
Mar 27, 2018, 1:44:12 AM3/27/18
to veg...@google.com, Flutter Dev
The `--trace-compiler` is the life saver here, thank you very much! 

The output clearly indicates that the problem lies in my own code, which is what I suspected anyway; just needed some trace to figure out where. 

(I had copied the `material/tabs.dart` file into my own project to make some modifications to override how it was drawing the indicator. I was fully aware of the hacky nature of that approach, but I needed to get things working without re-inventing too many wheels. I tried to isolate the issue to create a test-case, but sadly to no avail: once I put the affected file in a smaller project, it compiles it just fine.)

The problem went away as soon as I removed all that code and implemented the functionality in the proper way as the components now have support for exactly what I was trying to accomplish.

Again, thanks!

as...@google.com

unread,
Mar 28, 2018, 8:19:00 PM3/28/18
to Flutter Dev
Hi Hugo,

Good to hear that you were able to fix your code. We would still like to figure out why gen_snapshot ended up with a crash. Would it be possible to provide us with the snippet of code that triggered the crash so we can debug it on our side.

Thanks for your help.
Siva.
Reply all
Reply to author
Forward
0 new messages