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 memory leak in dart::bin::File::Open #35610

Open
sjindel-google opened this Issue Jan 9, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@sjindel-google
Copy link
Contributor

sjindel-google commented Jan 9, 2019

Seen 1 flaky VM crash on vm-kernel-asan-linux-release-x64.

stderr:
=================================================================
==16930==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x563f08c47b32 in operator new(unsigned long) /b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:106:3
    #1 0x563f08cc0854 in dart::bin::File::Open(dart::bin::Namespace*, char const*, dart::bin::File::FileOpenMode) ../../out/ReleaseX64/../../runtime/bin/file_linux.cc:235:10
    #2 0x563f08cb3902 in dart::bin::File::OpenRequest(dart::bin::CObjectArray const&) ../../out/ReleaseX64/../../runtime/bin/file.cc:909:16
    #3 0x563f08c69674 in dart::bin::IOServiceCallback(long, _Dart_CObject*) ../../out/ReleaseX64/../../runtime/bin/io_service.cc:44:7
    #4 0x563f09306506 in dart::NativeMessageHandler::HandleMessage(dart::Message*) ../../out/ReleaseX64/../../runtime/vm/native_message_handler.cc:41:3
    #5 0x563f092fd99c in dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) ../../out/ReleaseX64/../../runtime/vm/message_handler.cc:217:28
    #6 0x563f092ff2e5 in dart::MessageHandler::TaskCallback() ../../out/ReleaseX64/../../runtime/vm/message_handler.cc:417:20
    #7 0x563f0970ad9f in dart::ThreadPool::Worker::Loop() ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:381:11
    #8 0x563f0970aa5d in dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:436:27
    #9 0x563f094e525d in dart::ThreadStart(void*) ../../out/ReleaseX64/../../runtime/vm/os_thread_linux.cc:131:5
    #10 0x7f0355bb9183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)

Indirect leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x563f08c47b32 in operator new(unsigned long) /b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:106:3
    #1 0x563f08cc0861 in dart::bin::File::Open(dart::bin::Namespace*, char const*, dart::bin::File::FileOpenMode) ../../out/ReleaseX64/../../runtime/bin/file_linux.cc:235:19
    #2 0x563f08cb3902 in dart::bin::File::OpenRequest(dart::bin::CObjectArray const&) ../../out/ReleaseX64/../../runtime/bin/file.cc:909:16
    #3 0x563f08c69674 in dart::bin::IOServiceCallback(long, _Dart_CObject*) ../../out/ReleaseX64/../../runtime/bin/io_service.cc:44:7
    #4 0x563f09306506 in dart::NativeMessageHandler::HandleMessage(dart::Message*) ../../out/ReleaseX64/../../runtime/vm/native_message_handler.cc:41:3
    #5 0x563f092fd99c in dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) ../../out/ReleaseX64/../../runtime/vm/message_handler.cc:217:28
    #6 0x563f092ff2e5 in dart::MessageHandler::TaskCallback() ../../out/ReleaseX64/../../runtime/vm/message_handler.cc:417:20
    #7 0x563f0970ad9f in dart::ThreadPool::Worker::Loop() ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:381:11
    #8 0x563f0970aa5d in dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseX64/../../runtime/vm/thread_pool.cc:436:27
    #9 0x563f094e525d in dart::ThreadStart(void*) ../../out/ReleaseX64/../../runtime/vm/os_thread_linux.cc:131:5
    #10 0x7f0355bb9183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)

Full log:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8924813846634812048/+/steps/vm_tests/0/stdout

Could not reproduce locally with 1000 runs.

@rmacnak-google

This comment has been minimized.

Copy link
Member

rmacnak-google commented Jan 10, 2019

There's no finalizer for the file until the isolate receives the response message from the IOService: it's just sent as an int. If the isolate shuts down before processing this message, I think that would cause this leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment