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

ASAN build failure after "[ VM ] Add support for sampling old space allocations" #51023

Closed
sstrickl opened this issue Jan 16, 2023 · 0 comments
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening

Comments

@sstrickl
Copy link
Contributor

The build is failing on the ASAN bots due to a memory leak in gen_snapshot:

Example log:

...
[2370/2577] AR obj/runtime/libdart_precompiler_testing.a
[2371/2577] ACTION //runtime/bin:generate_snapshot_bin(//build/toolchain/linux:clang_x64)
FAILED: gen/runtime/bin/vm_snapshot_data.bin gen/runtime/bin/vm_snapshot_instructions.bin gen/runtime/bin/isolate_snapshot_data.bin gen/runtime/bin/isolate_snapshot_instructions.bin 
python3 ../../build/gn_run_binary.py compiled_action gen_snapshot --sound-null-safety --deterministic --snapshot_kind=core --vm_snapshot_data=gen/runtime/bin/vm_snapshot_data.bin --vm_snapshot_instructions=gen/runtime/bin/vm_snapshot_instructions.bin --isolate_snapshot_data=gen/runtime/bin/isolate_snapshot_data.bin --isolate_snapshot_instructions=gen/runtime/bin/isolate_snapshot_instructions.bin /b/s/w/ir/cache/builder/sdk/out/ReleaseASANX64/vm_platform_strong_stripped.dill
Command failed: /b/s/w/ir/cache/builder/sdk/out/ReleaseASANX64/gen_snapshot --sound-null-safety --deterministic --snapshot_kind=core --vm_snapshot_data=gen/runtime/bin/vm_snapshot_data.bin --vm_snapshot_instructions=gen/runtime/bin/vm_snapshot_instructions.bin --isolate_snapshot_data=gen/runtime/bin/isolate_snapshot_data.bin --isolate_snapshot_instructions=gen/runtime/bin/isolate_snapshot_instructions.bin /b/s/w/ir/cache/builder/sdk/out/ReleaseASANX64/vm_platform_strong_stripped.dill
output: 
=================================================================
==7105==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1258 byte(s) in 95 object(s) allocated from:
    #0 0x55d24a27986e in malloc ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x55d24a32176e in dart::malloc(unsigned long) ../../out/ReleaseASANX64/../../runtime/platform/allocation.cc:20:18
    #2 0x55d24a6d460f in dart::String::ToMallocCString() const ../../out/ReleaseASANX64/../../runtime/vm/object.cc:24460:48
    #3 0x55d24a6d460f in dart::Class::SetUserVisibleNameInClassTable() ../../out/ReleaseASANX64/../../runtime/vm/object.cc:5161:60
    #4 0x55d24a48023e in dart::ClassFinalizer::ProcessPendingClasses() ../../out/ReleaseASANX64/../../runtime/vm/class_finalizer.cc:219:11
    #5 0x55d24a3750d9 in dart::Finish(dart::Thread*) ../../out/ReleaseASANX64/../../runtime/vm/bootstrap.cc:44:8
    #6 0x55d24a3750d9 in dart::BootstrapFromKernel(dart::Thread*, unsigned char const*, long) ../../out/ReleaseASANX64/../../runtime/vm/bootstrap.cc:144:5
    #7 0x55d24a37455c in dart::Bootstrap::DoBootstrapping(unsigned char const*, long) ../../out/ReleaseASANX64/../../runtime/vm/bootstrap.cc:192:10
    #8 0x55d24a689aa3 in dart::Object::Init(dart::IsolateGroup*, unsigned char const*, long) ../../out/ReleaseASANX64/../../runtime/vm/object.cc:2477:15
    #9 0x55d24a4bbde1 in dart::Dart::InitIsolateFromSnapshot(dart::Thread*, dart::Isolate*, unsigned char const*, unsigned char const*, unsigned char const*, long) ../../out/ReleaseASANX64/../../runtime/vm/dart.cc:853:11
    #10 0x55d24a4bca1a in dart::Dart::InitializeIsolate(unsigned char const*, unsigned char const*, unsigned char const*, long, dart::IsolateGroup*, void*) ../../out/ReleaseASANX64/../../runtime/vm/dart.cc:990:9
    #11 0x55d24b95e5e8 in dart::CreateIsolate(dart::IsolateGroup*, bool, char const*, void*, char**) ../../out/ReleaseASANX64/../../runtime/vm/dart_api_impl.cc:1301:12
    #12 0x55d24b95f2a2 in Dart_CreateIsolateGroupFromKernel ../../out/ReleaseASANX64/../../runtime/vm/dart_api_impl.cc:1431:26
    #13 0x55d24a2b2e55 in dart::bin::CreateIsolateAndSnapshot(dart::bin::CommandLineOptions const&) ../../out/ReleaseASANX64/../../runtime/bin/gen_snapshot.cc:756:15
    #14 0x55d24a2b2e55 in dart::bin::main(int, char**) ../../out/ReleaseASANX64/../../runtime/bin/gen_snapshot.cc:940:16
    #15 0x7f68e405bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) (BuildId: f7307432a8b162377e77a182b6cc2e53d771ec4b)

SUMMARY: AddressSanitizer: 1258 byte(s) leaked in 95 allocation(s).

ninja: build stopped: subcommand failed.
buildtools/ninja/ninja -C out/ReleaseASANX64 -j200 -l64 runtime done.

/cc @bkonyi

@sstrickl sstrickl added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening labels Jan 16, 2023
copybara-service bot pushed a commit that referenced this issue Jan 16, 2023
This reverts commit 6e4c0c2.

Reason for revert: Broke ASAN builds

See #51023

Original change's description:
> [ VM ] Add support for sampling old space allocations
>
> TEST=DartAPI_HeapSampling
>
> Change-Id: Idf26fca6ae59720557d73627f727b00229dd1e9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273860
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Id704f9070c430234b7cd78d8c2b67a5ed3e503fe
Cq-Include-Trybots: luci.dart.try:vm-kernel-asan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279100
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
@bkonyi bkonyi self-assigned this Jan 16, 2023
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