Skip to content

SIGSEGV: @dart/runtime/vm/dart_entry.cc:181 while cross-compiling engine in AOT mode for ARMv7 32-bit architecture #74322

@dwrobel

Description

@dwrobel

I'm trying to cross-compile flutter-egine in AOT mode to ARMv7 32-bit architecture.

I'm using the version of the engine referenced by today's (2020-01-20) flutter master channel:

$ ./flutter --version
Flutter 1.26.0-2.0.pre.420 • channel master • https://github.com/flutter/flutter
Framework • revision b362d6f480 (4 hours ago) • 2021-01-20 18:47:51 +0800
Engine • revision b58dbc88fc
Tools • Dart 2.12.0 (build 2.12.0-240.0.dev)

Source reference: flutter/engine@b58dbc8

The compilation fails as follows:

Command failed: ./clang_x64/dart --deterministic --packages=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/flutter/flutter_frontend_server/.dart_tool/package_config.json --snapshot=gen/frontend_server.dart.snapshot --snapshot-depfile=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/frontend_server.dart.snapshot.d --snapshot-kind=kernel --dfe=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/third_party/dart/pkg/vm/bin/kernel_service.dart /data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/flutter/flutter_frontend_server/frontend_server.dart.dill

===== CRASH =====
si_signo=Segmentation fault(11), si_code=1, si_addr=0x7fa52b75ceac
Aborted

When I run unstripped version on gdb I got the following callstack:

$ gdb --args ./clang_x64/exe.unstripped/dart --deterministic --packages=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-n
eon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/flutter/flutter_frontend_server/.dart_tool/package_config.json --snapshot=gen/frontend_server.dart.snapshot --snapshot-depfile=/data/dwrobel1/onemw/onemw/oe-builds/
7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/frontend_server.dart.snapshot.d --snapshot-kind=kernel --dfe=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/third_party/dart/pkg/vm/bin/kernel_service.dart /data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/flutter/flutter_frontend_server/frontend_server.dart.dill
GNU gdb (GDB) Red Hat Enterprise Linux 8.0.1-36.el7
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./clang_x64/exe.unstripped/dart...done.
(gdb) r
Starting program: /data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/clang_x64/exe.unstripped/dart --deterministic --packages=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/flutter/flutter_frontend_server/.dart_tool/package_config.json --snapshot=gen/frontend_server.dart.snapshot --snapshot-depfile=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/frontend_server.dart.snapshot.d --snapshot-kind=kernel --dfe=/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/third_party/dart/pkg/vm/bin/kernel_service.dart /data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/engine/src/out/linux_release_arm/gen/flutter/flutter_frontend_server/frontend_server.dart.dill
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff7fe4700 (LWP 11399)]

Thread 1 "dart" received signal SIGSEGV, Segmentation fault.
0x00007fffd8edceac in ?? ()
(gdb) bt
#0  0x00007fffd8edceac in ?? ()
#1  0x0000555555835088 in dart::DartEntry::InvokeCode (code=..., arguments_descriptor=..., arguments=..., thread=thread@entry=0x5555572731f0) at ../../third_party/dart/runtime/vm/dart_entry.cc:181
#2  0x0000555555834e92 in dart::DartEntry::InvokeFunction (function=..., arguments=..., arguments_descriptor=..., current_sp=<optimized out>) at ../../third_party/dart/runtime/vm/dart_entry.cc:147
#3  0x0000555555897e0b in dart::Library::Invoke (this=<optimized out>, function_name=..., args=..., arg_names=..., respect_reflectable=false, check_is_entrypoint=false) at ../../third_party/dart/runtime/vm/object.cc:13011
#4  0x0000555555b12f08 in Dart_Invoke (target=<optimized out>, name=<optimized out>, number_of_arguments=<optimized out>, arguments=<optimized out>) at ../../third_party/dart/runtime/vm/dart_api_impl.cc:4687
#5  0x00005555557c1e86 in dart::bin::DartUtils::PrepareBuiltinLibrary (builtin_lib=builtin_lib@entry=0x555557273d90, internal_lib=internal_lib@entry=0x555557273d80, is_service_isolate=false, trace_loading=false)
    at ../../third_party/dart/runtime/bin/dartutils.cc:470
#6  0x00005555557c224d in dart::bin::DartUtils::PrepareForScriptLoading (is_service_isolate=false, trace_loading=false) at ../../third_party/dart/runtime/bin/dartutils.cc:585
#7  0x0000555555698601 in dart::bin::SetupCoreLibraries (isolate=0x5555572638e0, isolate_data=<optimized out>, is_isolate_group_start=true, resolved_packages_config=0x7fffffff9528) at ../../third_party/dart/runtime/bin/main.cc:165
#8  0x000055555569800c in dart::bin::IsolateSetupHelper (isolate=0x5555572638e0, is_main_isolate=true,
    script_uri=0x55555724eb00 "/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/eng"...,
    packages_config=<optimized out>, isolate_run_app_snapshot=false, flags=<optimized out>, error=0x7fffffff9678, exit_code=0x7fffffff9674) at ../../third_party/dart/runtime/bin/main.cc:277
#9  0x0000555555696a77 in dart::bin::CreateIsolateGroupAndSetupHelper (is_main_isolate=<optimized out>, script_uri=<optimized out>, name=<optimized out>,
    packages_config=0x7fffffffa1ce "/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/eng"..., flags=<optimized out>, callback_data=<optimized out>, error=<optimized out>, exit_code=<optimized out>) at ../../third_party/dart/runtime/bin/main.cc:803
#10 0x000055555569606d in dart::bin::RunMainIsolate (
    script_name=0x55555724eb00 "/data/dwrobel1/onemw/onemw/oe-builds/7218c-onemw-full-zb-k-2.2-flutter-gdb/onemw/build-brcm972180hbc-refboard/tmp/work/cortexa15t2hf-neon-vfpv4-rdk-linux-gnueabi/flutter-engine/2.12.0-240.0.dev-r0/eng"..., package_config_override=0x0, dart_options=0x7fffffff9710) at ../../third_party/dart/runtime/bin/main.cc:958
#11 0x00005555556973d6 in dart::bin::main (argc=8, argv=0x7fffffff98d8) at ../../third_party/dart/runtime/bin/main.cc:1362
#12 0x0000555555697f66 in main (argc=1462191424, argv=0x555557274440) at ../../third_party/dart/runtime/bin/main.cc:1400
(gdb) 

Additional information:

  • Options used for gn: ./src/flutter/tools/gn --no-build-glfw-shell --runtime-mode=release --lto --target-os=linux --linux-cpu="arm" --target-triple="arm-rdk-linux-gnueabi" --enable-fontconfig --embedder-for-target
  • The same version of the engine compiles fine natively on x86_64 platform - the only problem is during the cross compilation for ARMv7.
  • I first encounter this issue on the sources from 2020-12-10 flutter/engine@4797b06
  • The last working version I have for ARMv7 is from 2020-08-16 flutter/engine@e16bc50

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoledependency: dartDart team may need to help usengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions