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

Investigate why enabling constant validation after hot-reload discovers non-canonical constants #44862

Closed
mkustermann opened this issue Feb 5, 2021 · 0 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening

Comments

@mkustermann
Copy link
Member

We assumed validation of constants should be safe after hot-reload, so cl/182561 removed an old bailout. Though this turned out to reveal some existing issue:

/==================================================================================================\
| language_2/deferred/split_constants_canonicalization_test/0 broke (Pass -> Crash, expected Pass) |
\==================================================================================================/

--- Command "vm" (took 20.000131s):
DART_CONFIGURATION=DebugX64 out/DebugX64/dart --hot-reload-rollback-test-mode --use_bare_instructions=false --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/tests/language_2/deferred/split_constants_canonicalization_test.dart

exit code:
-6

stderr:
Instance `Instance` is not canonical!
../../runtime/vm/heap/verifier.cc: 117: error: expected: is_canonical
version=2.13.0-edge.36e10faa3b97094672d375b4acce2c5ff1bc3e8a (be) (Fri Feb 5 03:53:42 2021 +0000) on "linux_x64"
pid=10912, thread=10912, isolate_group=main(0x55ec2aac7000), isolate=main(0x55ec2acfd000)
isolate_instructions=55ec290baa40, vm_instructions=55ec290baa40
  pc 0x000055ec29486b4c fp 0x00007ffd5742c730 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000055ec290babf2 fp 0x00007ffd5742c810 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x000055ec2959729e fp 0x00007ffd5742c850 dart::VerifyCanonicalVisitor::VisitObject(dart::ObjectPtr)+0x13e
  pc 0x000055ec29581905 fp 0x00007ffd5742c8b0 dart::OldPage::VisitObjects(dart::ObjectVisitor*) const+0xe5
  pc 0x000055ec29585471 fp 0x00007ffd5742c920 dart::PageSpace::VisitObjects(dart::ObjectVisitor*) const+0x31
  pc 0x000055ec293484c2 fp 0x00007ffd5742c990 dart::Isolate::ValidateConstants()+0xc2
  pc 0x000055ec299c06c0 fp 0x00007ffd5742ca10 Dart_ShutdownIsolate+0xf0
  pc 0x000055ec290911bd fp 0x00007ffd5742caa0 dart::bin::RunMainIsolate(char const*, char const*, dart::bin::CommandLineOptions*)+0x5ad
  pc 0x000055ec2909209a fp 0x00007ffd5742cbd0 dart::bin::main(int, char**)+0x64a
  pc 0x000055ec29092fdd fp 0x00007ffd5742cbf0 main+0xd
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -n dartk-reload-rollback-linux-debug-x64 language_2/deferred/split_constants_canonicalization_test/0


/==================================================================================================\
| language_2/deferred/split_constants_canonicalization_test/1 broke (Pass -> Crash, expected Pass) |
\==================================================================================================/

--- Command "vm" (took 07.000634s):
DART_CONFIGURATION=DebugX64 out/DebugX64/dart --hot-reload-rollback-test-mode --use_bare_instructions=true --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/tests/language_2/deferred/split_constants_canonicalization_test.dart

exit code:
-6

stderr:
Instance `Instance` is not canonical!
../../runtime/vm/heap/verifier.cc: 117: error: expected: is_canonical
version=2.13.0-edge.36e10faa3b97094672d375b4acce2c5ff1bc3e8a (be) (Fri Feb 5 03:53:42 2021 +0000) on "linux_x64"
pid=10919, thread=10919, isolate_group=main(0x5639908d7000), isolate=main(0x563990972000)
isolate_instructions=56398dafaa40, vm_instructions=56398dafaa40
  pc 0x000056398dec6b4c fp 0x00007fff37642b60 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000056398dafabf2 fp 0x00007fff37642c40 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x000056398dfd729e fp 0x00007fff37642c80 dart::VerifyCanonicalVisitor::VisitObject(dart::ObjectPtr)+0x13e
  pc 0x000056398dfc1905 fp 0x00007fff37642ce0 dart::OldPage::VisitObjects(dart::ObjectVisitor*) const+0xe5
  pc 0x000056398dfc5471 fp 0x00007fff37642d50 dart::PageSpace::VisitObjects(dart::ObjectVisitor*) const+0x31
  pc 0x000056398dd884c2 fp 0x00007fff37642dc0 dart::Isolate::ValidateConstants()+0xc2
  pc 0x000056398e4006c0 fp 0x00007fff37642e40 Dart_ShutdownIsolate+0xf0
  pc 0x000056398dad11bd fp 0x00007fff37642ed0 dart::bin::RunMainIsolate(char const*, char const*, dart::bin::CommandLineOptions*)+0x5ad
  pc 0x000056398dad209a fp 0x00007fff37643000 dart::bin::main(int, char**)+0x64a
  pc 0x000056398dad2fdd fp 0x00007fff37643020 main+0xd
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -n dartk-reload-rollback-linux-debug-x64 language_2/deferred/split_constants_canonicalization_test/1


/================================================================\
| language_2/enum/enum_test broke (Pass -> Crash, expected Pass) |
\================================================================/

--- Command "vm" (took 07.000701s):
DART_CONFIGURATION=DebugX64 out/DebugX64/dart --hot-reload-rollback-test-mode --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/tests/language_2/enum/enum_test.dart

exit code:
-6

stderr:
Instance `Instance` is not canonical!
../../runtime/vm/heap/verifier.cc: 117: error: expected: is_canonical
version=2.13.0-edge.36e10faa3b97094672d375b4acce2c5ff1bc3e8a (be) (Fri Feb 5 03:53:42 2021 +0000) on "linux_x64"
pid=724, thread=724, isolate_group=main(0x55eb7978d000), isolate=main(0x55eb7982a000)
isolate_instructions=55eb776baa40, vm_instructions=55eb776baa40
  pc 0x000055eb77a86b4c fp 0x00007ffe7cd06f00 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000055eb776babf2 fp 0x00007ffe7cd06fe0 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x000055eb77b9729e fp 0x00007ffe7cd07020 dart::VerifyCanonicalVisitor::VisitObject(dart::ObjectPtr)+0x13e
  pc 0x000055eb77b81905 fp 0x00007ffe7cd07080 dart::OldPage::VisitObjects(dart::ObjectVisitor*) const+0xe5
  pc 0x000055eb77b85471 fp 0x00007ffe7cd070f0 dart::PageSpace::VisitObjects(dart::ObjectVisitor*) const+0x31
  pc 0x000055eb779484c2 fp 0x00007ffe7cd07160 dart::Isolate::ValidateConstants()+0xc2
  pc 0x000055eb77fc06c0 fp 0x00007ffe7cd071e0 Dart_ShutdownIsolate+0xf0
  pc 0x000055eb776911bd fp 0x00007ffe7cd07270 dart::bin::RunMainIsolate(char const*, char const*, dart::bin::CommandLineOptions*)+0x5ad
  pc 0x000055eb7769209a fp 0x00007ffe7cd073a0 dart::bin::main(int, char**)+0x64a
  pc 0x000055eb77692fdd fp 0x00007ffe7cd073c0 main+0xd
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -n dartk-reload-rollback-linux-debug-x64 language_2/enum/enum_test


/=============================================================================\
| lib_2/mirrors/enum_test failed again (RuntimeError -> Crash, expected Pass) |
\=============================================================================/

--- Command "vm" (took 05.000869s):
DART_CONFIGURATION=DebugX64 out/DebugX64/dart --hot-reload-rollback-test-mode --ignore-unrecognized-flags --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/tests/lib_2/mirrors/enum_test.dart

exit code:
-6

stderr:
Unhandled exception:
Expect.equals(expected: <0>, actual: <1>) fails.
#0      Expect._fail (package:expect/expect.dart:702:5)
#1      Expect.equals (package:expect/expect.dart:132:5)
#2      main (file:///b/s/w/ir/cache/builder/sdk/tests/lib_2/mirrors/enum_test.dart:20:10)
#3      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283:19)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Instance `Instance` is not canonical!
../../runtime/vm/heap/verifier.cc: 117: error: expected: is_canonical
version=2.13.0-edge.36e10faa3b97094672d375b4acce2c5ff1bc3e8a (be) (Fri Feb 5 03:53:42 2021 +0000) on "linux_x64"
pid=27711, thread=27711, isolate_group=main(0x558e4e4eb000), isolate=main(0x558e4e870000)
isolate_instructions=558e4b9d0a40, vm_instructions=558e4b9d0a40
  pc 0x0000558e4bd9cb4c fp 0x00007ffd8de21e20 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x0000558e4b9d0bf2 fp 0x00007ffd8de21f00 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x0000558e4bead29e fp 0x00007ffd8de21f40 dart::VerifyCanonicalVisitor::VisitObject(dart::ObjectPtr)+0x13e
  pc 0x0000558e4be97905 fp 0x00007ffd8de21fa0 dart::OldPage::VisitObjects(dart::ObjectVisitor*) const+0xe5
  pc 0x0000558e4be9b471 fp 0x00007ffd8de22010 dart::PageSpace::VisitObjects(dart::ObjectVisitor*) const+0x31
  pc 0x0000558e4bc5e4c2 fp 0x00007ffd8de22080 dart::Isolate::ValidateConstants()+0xc2
  pc 0x0000558e4c2d66c0 fp 0x00007ffd8de22100 Dart_ShutdownIsolate+0xf0
  pc 0x0000558e4b9a09ef fp 0x00007ffd8de221f0 dart::bin::ErrorExit(int, char const*, ...)+0x8f
  pc 0x0000558e4b9a6fc2 fp 0x00007ffd8de22280 dart::bin::RunMainIsolate(char const*, char const*, dart::bin::CommandLineOptions*)+0x3b2
  pc 0x0000558e4b9a809a fp 0x00007ffd8de223b0 dart::bin::main(int, char**)+0x64a
  pc 0x0000558e4b9a8fdd fp 0x00007ffd8de223d0 main+0xd
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -n dartk-reload-rollback-linux-debug-x64 lib_2/mirrors/enum_test


/========================================================================================\
| vm/dart_2/isolates/enum_isolate_regress41824_test broke (Pass -> Crash, expected Pass) |
\========================================================================================/

--- Command "vm" (took 11.000141s):
DART_CONFIGURATION=DebugX64 out/DebugX64/dart --hot-reload-rollback-test-mode --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/runtime/tests/vm/dart_2/isolates/enum_isolate_regress41824_test.dart

exit code:
-6

stdout:
spawning child isolate

stderr:
Instance `Instance` is not canonical!
../../runtime/vm/heap/verifier.cc: 117: error: expected: is_canonical
version=2.13.0-edge.36e10faa3b97094672d375b4acce2c5ff1bc3e8a (be) (Fri Feb 5 03:53:42 2021 +0000) on "linux_x64"
pid=531, thread=612, isolate_group=tryClose(0x55fd1feca000), isolate=tryClose(0x55fd1feca800)
isolate_instructions=55fd1e7b4a40, vm_instructions=55fd1e7b4a40
  pc 0x000055fd1eb80b4c fp 0x00007f18100fe930 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000055fd1e7b4bf2 fp 0x00007f18100fea10 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x000055fd1ec9129e fp 0x00007f18100fea50 dart::VerifyCanonicalVisitor::VisitObject(dart::ObjectPtr)+0x13e
  pc 0x000055fd1ec7b905 fp 0x00007f18100feab0 dart::OldPage::VisitObjects(dart::ObjectVisitor*) const+0xe5
  pc 0x000055fd1ec7f471 fp 0x00007f18100feb20 dart::PageSpace::VisitObjects(dart::ObjectVisitor*) const+0x31
  pc 0x000055fd1ea424c2 fp 0x00007f18100feb90 dart::Isolate::ValidateConstants()+0xc2
  pc 0x000055fd1f0ba6c0 fp 0x00007f18100fec10 Dart_ShutdownIsolate+0xf0
  pc 0x000055fd1ea88ef4 fp 0x00007f18100fec90 dart::MessageHandler::TaskCallback()+0x624
  pc 0x000055fd1ec40deb fp 0x00007f18100fed30 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x1cb
  pc 0x000055fd1ec41829 fp 0x00007f18100fed80 dart::ThreadPool::Worker::Main(unsigned long)+0x179
  pc 0x000055fd1eb79619 fp 0x00007f18100feed0 out/DebugX64/dart+0x1f25619
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -n dartk-reload-rollback-linux-debug-x64 vm/dart_2/isolates/enum_isolate_regress41824_test

/cc @rmacnak-google

@mkustermann mkustermann added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening labels Feb 5, 2021
dart-bot pushed a commit that referenced this issue Feb 5, 2021
…ter reload

While addresing a comment in the review of [0], the CL removed a bailout in
`Isolate::ValidateConstants()` that disabled validating of constants
when hot-reload was performed. Apparently there is still an issue with
that. So this CL adds this bailout again.

[0] https://dart-review.googlesource.com/c/sdk/+/182561

TEST=Partial revert, fixes constant validation failures.

Issue #44862

Change-Id: Iefe9acceb344e73fad97246064e91a32a00dad10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183002
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
copybara-service bot pushed a commit that referenced this issue Jul 19, 2023
This is already skipped for AOT and is unfixable after the DropTransitiveUserDefinedConstants optimizations.
This is already skipped for reload and is unfixable for issues related to 40442.
The non-reload JIT case isn't very interesting since each kernel constant will be loaded only once anyway.

TEST=ci
Bug: #27003
Bug: #44862
Change-Id: I0676a96426142600f4ed9ec638b344a858aab7dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314480
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
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, FFI, and the AOT and JIT backends. gardening
Projects
None yet
Development

No branches or pull requests

2 participants