flutter Dart -> Engine roll failing on unreachable assert failure - Dart

Starting from https://github.com/flutter/engine/pull/25669. Maybe due to https://dart.googlesource.com/sdk.git/+/2852408881936600ad881cb7ee19342054fabce3 ? /cc @alexmarkov

[ RUN      ] DartIsolateTest.IsolateCannotLoadAndRunUnknownDartEntrypoint
../../third_party/dart/runtime/vm/object.cc: 3282: error: unreachable code
version=2.14.0-19.0.dev (dev) (Mon Apr 19 22:31:38 2021 -0700) on "macos_x64"
pid=93198, thread=775, isolate_group=thisShouldNotExist(0x7fc39f01be00), isolate=thisShouldNotExist(0x7fc39f022200)
isolate_instructions=107e14000, vm_instructions=107e08000
  pc 0x000000010490dc65 fp 0x00007ffeeb634060 dart::Profiler::DumpStackTrace(void*)+0x85
  pc 0x000000010482a104 fp 0x00007ffeeb634140 dart::Assert::Fail(char const*, ...)+0x84
  pc 0x00000001048a95a5 fp 0x00007ffeeb634170 dart::Class::NumTypeArguments() const+0x65
  pc 0x0000000104852c7d fp 0x00007ffeeb634210 dart::ClassFinalizer::ExpandAndFinalizeTypeArguments(dart::AbstractType const&, dart::ZoneGrowableHandlePtrArray<dart::AbstractType const>*)+0x5d
  pc 0x0000000104853418 fp 0x00007ffeeb634260 dart::ClassFinalizer::FinalizeType(dart::AbstractType const&, dart::ClassFinalizer::FinalizationKind, dart::ZoneGrowableHandlePtrArray<dart::AbstractType const>*)+0x288
  pc 0x00000001048a8225 fp 0x00007ffeeb6342a0 dart::Class::DeclarationType() const+0x155
  pc 0x00000001048c56fb fp 0x00007ffeeb634300 dart::Library::InvokeGetter(dart::String const&, bool, bool, bool) const+0x3fb
  pc 0x0000000104e7d859 fp 0x00007ffeeb6343e0 Dart_GetField+0x529
  pc 0x00000001045ee04d fp 0x00007ffeeb634560 flutter::DartIsolate::RunFromLibrary(std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)+0x13d
  pc 0x00000001045ed324 fp 0x00007ffeeb634890 flutter::DartIsolate::CreateRunningRootIsolate(flutter::Settings const&, fml::RefPtr<flutter::DartSnapshot const>, flutter::TaskRunners, std::__1::unique_ptr<flutter::PlatformConfiguration, std::__1::default_delete<flutter::PlatformConfiguration> >, fml::WeakPtr<flutter::SnapshotDelegate>, fml::WeakPtr<flutter::HintFreedDelegate>, fml::WeakPtr<flutter::IOManager>, fml::RefPtr<flutter::SkiaUnrefQueue>, fml::WeakPtr<flutter::ImageDecoder>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, flutter::DartIsolate::Flags, std::__1::function<void ()> const&, std::__1::function<void ()> const&, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::unique_ptr<flutter::IsolateConfiguration, std::__1::default_delete<flutter::IsolateConfiguration> >, std::__1::shared_ptr<flutter::VolatilePathTracker>, flutter::DartIsolate const*)+0x654
  pc 0x0000000104618d00 fp 0x00007ffeeb6351c0 flutter::testing::RunDartCodeInIsolateOnUITaskRunner(flutter::DartVMRef&, flutter::Settings const&, flutter::TaskRunners const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, fml::WeakPtr<flutter::IOManager>, std::__1::shared_ptr<flutter::VolatilePathTracker>)+0x450
  pc 0x000000010461a964 fp 0x00007ffeeb635270 std::__1::__function::__func<fml::internal::CopyableLambda<flutter::testing::RunDartCodeInIsolate(flutter::DartVMRef&, flutter::Settings const&, flutter::TaskRunners const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, fml::WeakPtr<flutter::IOManager>, std::__1::shared_ptr<flutter::VolatilePathTracker>)::$_1>, std::__1::allocator<fml::internal::CopyableLambda<flutter::testing::RunDartCodeInIsolate(flutter::DartVMRef&, flutter::Settings const&, flutter::TaskRunners const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, fml::WeakPtr<flutter::IOManager>, std::__1::shared_ptr<flutter::VolatilePathTracker>)::$_1> >, void ()>::operator()()+0xb4
  pc 0x0000000104619550 fp 0x00007ffeeb635380 flutter::testing::RunDartCodeInIsolate(flutter::DartVMRef&, flutter::Settings const&, flutter::TaskRunners const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, fml::WeakPtr<flutter::IOManager>, std::__1::shared_ptr<flutter::VolatilePathTracker>)+0x120
  pc 0x00000001045d09ef fp 0x00007ffeeb636050 flutter::testing::DartIsolateTest_IsolateCannotLoadAndRunUnknownDartEntrypoint_Test::TestBody()+0x2ff
  pc 0x0000000104ec4bc0 fp 0x00007ffeeb636090 testing::Test::Run()+0xe0
  pc 0x0000000104ec58f0 fp 0x00007ffeeb6360f0 testing::TestInfo::Run()+0x110
  pc 0x0000000104ec62d0 fp 0x00007ffeeb636140 testing::TestSuite::Run()+0x130
  pc 0x0000000104ed2b94 fp 0x00007ffeeb636200 testing::internal::UnitTestImpl::RunAllTests()+0x3e4
  pc 0x0000000104ed26ff fp 0x00007ffeeb636250 testing::UnitTest::Run()+0x7f
  pc 0x0000000104615f1f fp 0x00007ffeeb6363b0 main+0x12f
  pc 0x00007fff6e378cc9 fp 0x00007ffeeb6363c0 start+0x1
-- End of DumpStackTrace
Asked Oct 19 '21 02:10
avatar zanderso
zanderso

4 Answer:

The problem is that VM sometimes creates types for artificial top-level classes, but finalization of such classes doesn't initialize their number of type arguments. That caused the crash in AOT mode after I removed calculation of number of type arguments from AOT runtime. I'm going to reland the original CL with the fix for this issue.

1
Answered Apr 20 '21 at 18:27
avatar  of alexmarkov
alexmarkov

In a host_profile Engine build on Mac or Linux:

$ out/host_profile/runtime_unittests --gtest_shuffle --gtest_repeat=2
1
Answered Apr 20 '21 at 17:02
avatar  of zanderso
zanderso

Fixed in patchset 2 of https://dart-review.googlesource.com/c/sdk/+/196103/.

1
Answered Apr 20 '21 at 21:14
avatar  of alexmarkov
alexmarkov

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

1
Answered Aug 02 '21 at 21:00
avatar  of github-actions[bot]
github-actions[bot]