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

Flaky memory leaks in ffi/vmspecific_function_callbacks_test (with ASAN) #39720

Closed
alexmarkov opened this issue Dec 9, 2019 · 1 comment
Closed
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening

Comments

@alexmarkov
Copy link
Contributor

 /==================================================================================\
 | ffi/vmspecific_function_callbacks_test/01/4 broke (Pass -> Crash, expected Pass) |
 \==================================================================================/
 --- Command "vm" (took 05.000556s):
 DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart --enable-testing-pragmas --write-protect-code --no-dual-map-code --ignore-unrecognized-flags --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_tests/ffi/vmspecific_function_callbacks_test_01.dart
 exit code:
 -6
 stderr:
 **** EXPECT STACKTRACE TO FOLLOW. THIS IS OK. ****
 ../../runtime/vm/runtime_entry.cc: 3217: error: Cannot invoke native callback outside an isolate.
 version=2.8.0-edge.c31db57c97e2182a43f9074f0432da06906eb96b (Sat Dec 7 01:36:34 2019 +0000) on "linux_x64"
 thread=9008, isolate=(null)((nil))
   pc 0x000055d4a5b34d1b fp 0x00007febc57998f0 dart::Profiler::DumpStackTrace(void*)
   pc 0x000055d4a5344e06 fp 0x00007febc5799a70 dart::Assert::Fail(char const*, ...)
   pc 0x000055d4a5c5b745 fp 0x00007febc5799b80 out/ReleaseX64/dart+0x26c2745
   pc 0x00007febd5c17f6e fp 0x00007febc5799b90 Unknown symbol
   pc 0xf8f8f8f8f8f8f8f8 fp 0x00007febc5799eb0 Unknown symbol
   pc 0x00007febc5802dcf fp 0x00007febc5799ed0 /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/libffi_test_functions.so+0x67dcf
 -- End of DumpStackTrace
 ===== CRASH =====
 si_signo=Segmentation fault(11), si_code=1, si_addr=0x518
 Aborting re-entrant request for stack trace.
 =================================================================
 ==8928==ERROR: LeakSanitizer: detected memory leaks
 Direct leak of 48 byte(s) in 1 object(s) allocated from:
     #0 0x55d4a52f5b32 in operator new(unsigned long) /b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:106:3
     #1 0x55d4a5d2b82a in dart::VirtualMemory::AllocateAligned(long, long, bool, char const*) ../../out/ReleaseX64/../../runtime/vm/virtual_memory_posix.cc:244:10
     #2 0x55d4a62af154 in dart::HeapPage::Allocate(long, dart::HeapPage::PageType, char const*) ../../out/ReleaseX64/../../runtime/vm/heap/pages.cc:51:27
     #3 0x55d4a62af154 in dart::PageSpace::AllocatePage(dart::HeapPage::PageType, bool) ../../out/ReleaseX64/../../runtime/vm/heap/pages.cc:289
     #4 0x55d4a62b0a58 in dart::PageSpace::TryAllocateInFreshPage(long, dart::HeapPage::PageType, dart::PageSpace::GrowthPolicy, bool) ../../out/ReleaseX64/../../runtime/vm/heap/pages.cc:456:22
     #5 0x55d4a62b0f8e in dart::PageSpace::TryAllocateInternal(long, dart::HeapPage::PageType, dart::PageSpace::GrowthPolicy, bool, bool) ../../out/ReleaseX64/../../runtime/vm/heap/pages.cc:493:16
     #6 0x55d4a6299983 in dart::PageSpace::TryAllocate(long, dart::HeapPage::PageType, dart::PageSpace::GrowthPolicy) ../../out/ReleaseX64/../../runtime/vm/heap/pages.h:283:12
     #7 0x55d4a6299983 in dart::Heap::AllocateOld(long, dart::HeapPage::PageType) ../../out/ReleaseX64/../../runtime/vm/heap/heap.cc:131
     #8 0x55d4a597eed6 in dart::Object::Allocate(long, long, dart::Heap::Space) ../../out/ReleaseX64/../../runtime/vm/heap/heap.h
     #9 0x55d4a59cf7ed in dart::Type::New(dart::Heap::Space) ../../out/ReleaseX64/../../runtime/vm/object.cc:18394:7
     #10 0x55d4a59cf7ed in dart::Type::New(dart::Class const&, dart::TypeArguments const&, dart::TokenPosition, dart::Nullability, dart::Heap::Space) ../../out/ReleaseX64/../../runtime/vm/object.cc:18404
     #11 0x55d4a59cf7ed in dart::Class::RareType() const ../../out/ReleaseX64/../../runtime/vm/object.cc:2459
     #12 0x55d4a605f0aa in dart::CompileType::ToAbstractType() ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:783:50
     #13 0x55d4a5e24514 in dart::CompileType::IsEqualTo(dart::CompileType*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/compile_type.h:173:36
     #14 0x55d4a5e24514 in dart::Definition::UpdateType(dart::CompileType) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/il.h:2134
     #15 0x55d4a606379a in dart::RedefinitionInstr::RecomputeType() ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:941:10
     #16 0x55d4a6054e19 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:143:30
     #17 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #18 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #19 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #20 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #21 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #22 0x55d4a6055066 in dart::FlowGraphTypePropagator::PropagateRecursive(dart::BlockEntryInstr*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:159:5
     #23 0x55d4a60525fb in dart::FlowGraphTypePropagator::Propagate() ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:78:3
     #24 0x55d4a605242c in dart::FlowGraphTypePropagator::Propagate(dart::FlowGraph*) ../../out/ReleaseX64/../../runtime/vm/compiler/backend/type_propagator.cc:47:14
     #25 0x55d4a609c44f in dart::CompilerPass_TypePropagation::DoBody(dart::CompilerPassState*) const ../../out/ReleaseX64/../../runtime/vm/compiler/compiler_pass.cc:382:1
     #26 0x55d4a609b1cc in dart::CompilerPass::Run(dart::CompilerPassState*) const ../../out/ReleaseX64/../../runtime/vm/compiler/compiler_pass.cc:189:16
     #27 0x55d4a609bdec in dart::CompilerPass::RunPipeline(dart::CompilerPass::PipelineMode, dart::CompilerPassState*) ../../out/ReleaseX64/../../runtime/vm/compiler/compiler_pass.cc:292:3
     #28 0x55d4a624279f in dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*) ../../out/ReleaseX64/../../runtime/vm/compiler/jit/compiler.cc:630:22
     #29 0x55d4a6244ac8 in dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long) ../../out/ReleaseX64/../../runtime/vm/compiler/jit/compiler.cc:769:46
     #30 0x55d4a6246143 in dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long) ../../out/ReleaseX64/../../runtime/vm/compiler/jit/compiler.cc:965:10
     #31 0x55d4a6247d33 in dart::BackgroundCompiler::Run() ../../out/ReleaseX64/../../runtime/vm/compiler/jit/compiler.cc:1238:11
     #32 0x55d4a5cfbd0f in dart::ThreadPool::Worker::Loop() ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:382:11
     #33 0x55d4a5cfb8e2 in dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:434:27
     #34 0x55d4a5b2995e in dart::ThreadStart(void*) ../../out/ReleaseX64/../../runtime/vm/os_thread_linux.cc:138:5
 SUMMARY: AddressSanitizer: 48 byte(s) leaked in 1 allocation(s).
 --- Re-run this test:
 python tools/test.py -n dartk-asan-linux-release-x64 ffi/vmspecific_function_callbacks_test/01/4

log1, log2.

Repro:

export DART_USE_ASAN=1
tools/build.py -a x64 -m release runtime
tools/test.py --repeat 100 -n dartk-asan-linux-release-x64 ffi/vmspecific_function_callbacks_test/01

This is similar to #38121, but happens in another test.
/cc @dcharkes @sjindel-google

@alexmarkov alexmarkov added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening labels Dec 9, 2019
@dcharkes
Copy link
Contributor

@mkustermann it looks like with splitting up the tests we forgot to update the status file.

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, and the AOT and JIT backends. gardening
Projects
None yet
Development

No branches or pull requests

2 participants