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

Dart -> Engine roll failing on unreachable assert failure #80801

Closed
zanderso opened this issue Apr 20, 2021 · 5 comments
Closed

Dart -> Engine roll failing on unreachable assert failure #80801

zanderso opened this issue Apr 20, 2021 · 5 comments
Assignees
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P0 Critical issues such as a build break or regression team Infra upgrades, team productivity, code health, technical debt. See also team: labels.

Comments

@zanderso
Copy link
Member

Starting from flutter/engine#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
@zanderso zanderso added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. engine flutter/engine repository. See also e: labels. dependency: dart Dart team may need to help us P1 labels Apr 20, 2021
@alexmarkov alexmarkov self-assigned this Apr 20, 2021
@alexmarkov
Copy link
Contributor

@zanderso How can I reproduce the failure?

@zanderso
Copy link
Member Author

In a host_profile Engine build on Mac or Linux:

$ out/host_profile/runtime_unittests --gtest_shuffle --gtest_repeat=2

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Apr 20, 2021
This reverts commit 2852408.

Reason for revert: failures on Flutter engine tests.
Issue: flutter/flutter#80801

Original change's description:
> [vm] Reduce size of Class objects in AOT and PRODUCT modes
>
> This change conditionally removes certain fields from Class objects
> in AOT and PRODUCT modes.
>
> Flutter gallery in release-sizeopt mode:
> Snapshot size -0.47% (arm64), -0.44% (arm)
> Heap size of snapshot objects -4.1% (arm64), -4.3% (arm)
>
> On a large Flutter application compiled in --dwarf-stack-traces mode:
> Heap size of Class objects -26%
> Heap size of all snapshot objects -3.6%
>
> TEST=ci
> Issue: #44020
> Change-Id: I795c625b71558cd2f336f92fc326c36fd339cd4b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195700
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=vegorov@google.com,rmacnak@google.com,alexmarkov@google.com,sstrickl@google.com

Change-Id: I0dbf1d5fc139f3654ce52f185b799c09bba66de7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: #44020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196102
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
@alexmarkov
Copy link
Contributor

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.

@alexmarkov
Copy link
Contributor

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

@github-actions
Copy link

github-actions bot commented Aug 2, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
@flutter-triage-bot flutter-triage-bot bot added P0 Critical issues such as a build break or regression and removed P1 labels Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P0 Critical issues such as a build break or regression team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

No branches or pull requests

2 participants