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

vm/dart_2/isolates/closure_entrypoint_test/3 crashes with compressed pointers #47235

Closed
alexmarkov opened this issue Sep 16, 2021 · 3 comments
Closed
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening

Comments

@alexmarkov
Copy link
Contributor

The crash is flaky, but can be easily reproduced (crashed in ~25% of runs):

tools/test.py --repeat 100 -n dartkp-linux-debug-x64c vm/dart_2/isolates/closure_entrypoint_test/3
/===================================================================================\
| vm/dart_2/isolates/closure_entrypoint_test/3 broke (Pass -> Crash, expected Pass) |
\===================================================================================/

--- Command "vm_compile_to_kernel" (took 06.000694s):
DART_CONFIGURATION=DebugX64C /b/s/w/ir/pkg/vm/tool/gen_kernel --aot --platform=out/DebugX64C/vm_platform_strong.dill -o /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.dill /b/s/w/ir/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart --packages=/b/s/w/ir/.packages -Ddart.vm.product=false

exit code:
0

--- Command "precompiler" (took 19.000148s):
DART_CONFIGURATION=DebugX64C out/DebugX64C/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.S --enable-isolate-groups --enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.dill

exit code:
0

--- Command "remove_kernel_file" (took 32ms):
DART_CONFIGURATION=DebugX64C rm /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.dill

exit code:
0

--- Command "assemble" (took 01.000503s):
DART_CONFIGURATION=DebugX64C gcc -m64 -shared -nostdlib -o /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.aotsnapshot /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.S

exit code:
0

--- Command "remove_assembly" (took 17ms):
DART_CONFIGURATION=DebugX64C rm /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.S

exit code:
0

--- Command "vm" (took 182ms):
DART_CONFIGURATION=DebugX64C out/DebugX64C/dart_precompiled_runtime --enable-isolate-groups --enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.aotsnapshot

exit code:
-6

stdout:
noCapturedVariablesTest
capturedInt
capturedInstanceValue
captureThisViaMethodTearOff
captureInvalidObject

stderr:
../../runtime/vm/tagged_pointer.h: 80: error: expected: IsWellFormed()
version=2.15.0-edge.63f21ac34c9590247814e3b55ac791426dd85c20 (be) (Thu Sep 16 04:01:35 2021 +0000) on "linux_x64"
pid=6999, thread=7002, isolate_group=main(0x55ae62a45800), isolate=(nil)((nil))
isolate_instructions=7feeeac516d0, vm_instructions=7feeeac4d340
  pc 0x000055ae610ffd0c fp 0x00007feeea946830 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000055ae60dbd4b4 fp 0x00007feeea946910 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000055ae611bfcc9 fp 0x00007feeea946980 out/DebugX64C/dart_precompiled_runtime+0xa53cc9
  pc 0x000055ae6110ecb3 fp 0x00007feeea9469c0 dart::UntaggedContext::VisitContextPointers(dart::ContextPtr, dart::ObjectPointerVisitor*)+0x83
  pc 0x000055ae6110d401 fp 0x00007feeea946a00 dart::UntaggedObject::VisitPointersPredefined(dart::ObjectPointerVisitor*, long)+0x2b1
  pc 0x000055ae611c0415 fp 0x00007feeea946a50 out/DebugX64C/dart_precompiled_runtime+0xa54415
  pc 0x000055ae611bede0 fp 0x00007feeea946b80 out/DebugX64C/dart_precompiled_runtime+0xa52de0
  pc 0x000055ae611bc2bd fp 0x00007feeea946c00 out/DebugX64C/dart_precompiled_runtime+0xa502bd
  pc 0x000055ae611beabb fp 0x00007feeea946c30 out/DebugX64C/dart_precompiled_runtime+0xa52abb
  pc 0x000055ae61182ebb fp 0x00007feeea946cd0 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x1fb
  pc 0x000055ae61183857 fp 0x00007feeea946d20 dart::ThreadPool::Worker::Main(unsigned long)+0x147
  pc 0x000055ae610f8c44 fp 0x00007feeea946e70 out/DebugX64C/dart_precompiled_runtime+0x98cc44
-- End of DumpStackTrace

--- Re-run this test:
python3 tools/test.py -n dartkp-linux-debug-x64c vm/dart_2/isolates/closure_entrypoint_test/3

Stack trace in debugger:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f089d500537 in __GI_abort () at abort.c:79
#2  0x000055c8ef32423e in dart::Assert::Fail (this=<optimized out>, format=<optimized out>) at ../../runtime/platform/assert.cc:55
#3  0x000055c8ef6cf6b1 in dart::StackFrame::GetCodeObject (this=<optimized out>, this@entry=0x7f089c0f2c10) at ../../runtime/vm/thread.h:593
#4  0x000055c8ef6cf78a in dart::StackFrame::ToCString (this=0x7f089c0f2c10) at ../../runtime/vm/stack_frame.cc:165
#5  0x000055c8ef6d0d58 in dart::StackFrame::DumpCurrentTrace () at ../../runtime/vm/stack_frame.cc:442
#6  0x000055c8ef667148 in dart::Profiler::DumpStackTrace (sp=<optimized out>, fp=139674954706352, pc=94321498287452, for_crash=<optimized out>) at ../../runtime/vm/profiler.cc:1265
#7  0x000055c8ef324234 in dart::Assert::Fail (this=<optimized out>, format=<optimized out>) at ../../runtime/platform/assert.cc:53
#8  0x000055c8ef727769 in dart::ScavengerVisitorBase<true>::VisitCompressedPointers (this=<optimized out>, heap_base=<optimized out>, first=<optimized out>, last=<optimized out>)
    at ../../runtime/vm/heap/scavenger.cc:352
#9  0x000055c8ef676273 in dart::UntaggedContext::VisitContextPointers (raw_obj=..., visitor=0x55c8f10d0cf0) at ../../runtime/vm/raw_object.cc:570
#10 0x000055c8ef6749c1 in dart::UntaggedObject::VisitPointersPredefined (this=0x7f0700880620, visitor=0x7f089c0f2820, class_id=27) at ../../runtime/vm/raw_object.cc:299
#11 0x000055c8ef727eb5 in dart::ScavengerVisitorBase<true>::ProcessPromotedList (this=this@entry=0x55c8f10d0cf0) at ../../runtime/vm/heap/scavenger.cc:1260
#12 0x000055c8ef726880 in dart::ScavengerVisitorBase<true>::ProcessSurvivors (this=0x55c8f10d0cf0) at ../../runtime/vm/heap/scavenger.cc:231
#13 0x000055c8ef723d5d in dart::ParallelScavengerTask::RunEnteredIsolateGroup (this=this@entry=0x7f089c0f3200) at ../../runtime/vm/heap/scavenger.cc:568
#14 0x000055c8ef72336b in dart::Scavenger::ParallelScavenge (this=this@entry=0x55c8f10e2e10, from=0x55c8f10bf1e0) at ../../runtime/vm/heap/scavenger.cc:1684
#15 0x000055c8ef722d21 in dart::Scavenger::Scavenge (this=this@entry=0x55c8f10e2e10) at ../../runtime/vm/heap/scavenger.cc:1610
#16 0x000055c8ef7241a7 in dart::Scavenger::Evacuate (this=0x55c8f10e2e10) at ../../runtime/vm/heap/scavenger.cc:1820
#17 0x000055c8ef70bd82 in dart::Heap::EvacuateNewSpace (this=this@entry=0x55c8f10e2e00, thread=thread@entry=0x55c8f10f8700, reason=reason@entry=dart::Heap::kLowMemory)
    at ../../runtime/vm/heap/heap.cc:439
#18 0x000055c8ef70a010 in dart::Heap::CollectAllGarbage (this=0x55c8f10e2e00, reason=dart::Heap::kLowMemory) at ../../runtime/vm/heap/heap.cc:564
#19 0x000055c8ef63dd87 in dart::ObjectGraphCopier::CopyObjectGraphInternal (this=this@entry=0x7f089c0f3630, root=..., exception_msg=exception_msg@entry=0x7f089c0f35e0)
    at ../../runtime/vm/object_graph_copy.cc:1744
#20 0x000055c8ef63cb89 in dart::ObjectGraphCopier::CopyObjectGraph (this=this@entry=0x7f089c0f3630, root=...) at ../../runtime/vm/object_graph_copy.cc:1661
#21 0x000055c8ef63c70d in dart::CopyMutableObjectGraph (object=...) at ../../runtime/vm/object_graph_copy.cc:1871
#22 0x000055c8ef4d1fd4 in dart::DN_HelperIsolate_spawnFunction (isolate=0x55c8f10c8800, zone=0x55c8f1194000, arguments=<optimized out>, thread=<optimized out>) at ../../runtime/lib/isolate.cc:933
#23 dart::BootstrapNatives::DN_Isolate_spawnFunction (thread=thread@entry=0x55c8f10f8700, zone=0x55c8f1194000, arguments=<optimized out>, arguments@entry=0x7f089c0f3a20)
    at ../../runtime/lib/isolate.cc:910
#24 0x000055c8ef581975 in dart::NativeEntry::BootstrapNativeCallWrapper (args=0x7f089c0f3a20, 
    func=0x55c8ef4d16b0 <dart::BootstrapNatives::DN_Isolate_spawnFunction(dart::Thread*, dart::Zone*, dart::NativeArguments*)>) at ../../runtime/vm/native_entry.cc:140
#25 0x00007f089d31300f in Precompiled_Stub_CallBootstrapNative ()
   from /.../dart/sdk/out/DebugX64C/generated_compilations/dartkp-linux-debug-x64c/runtime_tests_vm_dart_2_isolates_closure_entrypoint_test.dart_3/out.aotsnapshot
#26 0x00007f089d371557 in Isolate._spawnFunction () at dart:isolate-patch/isolate_patch.dart:395
#27 0x00007f089d37095d in Isolate.spawn () at dart:isolate-patch/isolate_patch.dart:375
#28 0x00007f089d37044a in Isolate.spawn () at dart:isolate-patch/isolate_patch.dart:345
#29 0x00007f089d40a1df in testWithClosure () at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:35
#30 0x00007f089d407bda in testWithClosure () at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:31
#31 0x00007f089d408c4a in ClosureEntrypointTester.captureInvalidObject.<anonymous closure> ()
    at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:85
#32 0x00007f089d407189 in ClosureEntrypointTester.throwsAsync () at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:102
#33 0x00007f089d406ff1 in ClosureEntrypointTester.throwsAsync () at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:100
#34 0x00007f089d408b73 in ClosureEntrypointTester.captureInvalidObject ()
    at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:85
#35 0x00007f089d408a12 in ClosureEntrypointTester.captureInvalidObject ()
    at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:77
#36 0x00007f089d40865b in ClosureEntrypointTester.run () at file:///.../dart/sdk/runtime/tests/vm/dart_2/isolates/closure_entrypoint_test.dart:52

Similar crashes also happen on dartk-linux-debug-x64c, dartk-linux-debug-simarm64c and dartkp-linux-debug-simarm64c configurations.

/cc @rmacnak-google as this could be related to compressed pointers.
/cc @mkustermann @aam as this could be related to lightweight isolates.

@alexmarkov alexmarkov added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening labels Sep 16, 2021
@rmacnak-google
Copy link
Contributor

More likely related to compressed pointers since Context was recently switched over.

@alexmarkov
Copy link
Contributor Author

Similar crash also happens on vm/dart_2/isolates/fast_object_copy_test/4:

tools/test.py --repeat 100 -n dartk-linux-debug-x64c vm/dart_2/isolates/fast_object_copy_test/4
../../runtime/vm/tagged_pointer.h: 80: error: expected: IsWellFormed()
version=2.15.0-edge.63f21ac34c9590247814e3b55ac791426dd85c20 (be) (Thu Sep 16 04:01:35 2021 +0000) on "linux_x64"
pid=1490, thread=1494, isolate_group=main(0x56309cd7b000), isolate=(nil)((nil))
isolate_instructions=56309b584420, vm_instructions=56309b584420
  pc 0x000056309b96d3dc fp 0x00007f10eb07d830 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x000056309b5845d4 fp 0x00007f10eb07d910 dart::Assert::Fail(char const*, ...) const+0x84
  pc 0x000056309ba6da29 fp 0x00007f10eb07d980 out/DebugX64C/dart+0x2388a29
  pc 0x000056309b986803 fp 0x00007f10eb07d9c0 dart::UntaggedContext::VisitContextPointers(dart::ContextPtr, dart::ObjectPointerVisitor*)+0x83
  pc 0x000056309b984f81 fp 0x00007f10eb07da00 dart::UntaggedObject::VisitPointersPredefined(dart::ObjectPointerVisitor*, long)+0x2b1
  pc 0x000056309ba6e1d9 fp 0x00007f10eb07da50 out/DebugX64C/dart+0x23891d9
  pc 0x000056309ba6cbd0 fp 0x00007f10eb07db80 out/DebugX64C/dart+0x2387bd0
  pc 0x000056309ba6a05d fp 0x00007f10eb07dc00 out/DebugX64C/dart+0x238505d
  pc 0x000056309ba6c8ab fp 0x00007f10eb07dc30 out/DebugX64C/dart+0x23878ab
  pc 0x000056309ba217fb fp 0x00007f10eb07dcd0 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x1fb
  pc 0x000056309ba22197 fp 0x00007f10eb07dd20 dart::ThreadPool::Worker::Main(unsigned long)+0x147
  pc 0x000056309b9645b4 fp 0x00007f10eb07de70 out/DebugX64C/dart+0x227f5b4
-- End of DumpStackTrace

--- Re-run this test:
python3 tools/test.py -n dartk-linux-debug-x64c vm/dart_2/isolates/fast_object_copy_test/4

@rmacnak-google
Copy link
Contributor

dart-bot pushed a commit that referenced this issue Sep 16, 2021
…bailout.

Cf. 179c96c.

TEST=ci
Bug: #47235
Change-Id: I9f6aef564286f6b239d697072ed5405085269add
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213681
Reviewed-by: Liam Appelbe <liama@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