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

LSAN: Memory leak in file system watcher #52816

Closed
rmacnak-google opened this issue Jun 29, 2023 · 1 comment
Closed

LSAN: Memory leak in file system watcher #52816

rmacnak-google opened this issue Jun 29, 2023 · 1 comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io

Comments

@rmacnak-google
Copy link
Contributor

=================================================================
==15874==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 180 byte(s) in 9 object(s) allocated from:
    #0 0x55a56a32f6dd in strdup ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/asan/asan_interceptors.cpp:475:3
    #1 0x55a56a687fdb in dart::bin::OSError::SetMessage(char const*) out/ReleaseASANX64/../../runtime/bin/utils.h:47:18
    #2 0x55a56a687fdb in dart::bin::OSError::SetCodeAndMessage(dart::bin::OSError::SubSystem, int) out/ReleaseASANX64/../../runtime/bin/utils_linux.cc:34:5
    #3 0x55a56a687fdb in dart::bin::OSError::Reload() out/ReleaseASANX64/../../runtime/bin/utils_linux.cc:25:3
    #4 0x55a56a687fdb in dart::bin::OSError::OSError() out/ReleaseASANX64/../../runtime/bin/utils_linux.cc:21:3
    #5 0x55a56a3c2833 in dart::bin::Builtin_FileSystemWatcher_InitWatcher(_Dart_NativeArguments*) out/ReleaseASANX64/../../runtime/bin/file_system_watcher.cc:28:13
    #6 0x55a56a847ede in dart::NativeEntry::AutoScopeNativeCallWrapperNoStackCheck(_Dart_NativeArguments*, void (*)(_Dart_NativeArguments*)) out/ReleaseASANX64/../../runtime/vm/native_entry.cc:217:7
    #7 0x7f9df995c70a in stub CallAutoScopeNative /b/s/w/itj2kfje23/cc2p0ZTr.o
    #8 0x7f9df99c4a05 in _FileSystemWatcher._initWatcher dart:io-patch/file_patch.dart:384
    #9 0x7f9df99c20ce in _FileSystemWatcher._listen (#2) dart:io-patch/file_patch.dart:178
    #10 0x7f9df99c208a in _FileSystemWatcher._listen dart:io-patch/file_patch.dart
    #11 0x7f9df997c370 in _runGuarded dart:async/stream_controller.dart:823
    #12 0x7f9df99e5d31 in _BroadcastStreamController._subscribe dart:async/broadcast_stream_controller.dart:207
    #13 0x7f9df9992295 in _ControllerStream._createSubscription dart:async/stream_controller.dart:836
    #14 0x7f9df9a15cf4 in _StreamImpl.listen dart:async/stream_impl.dart:471
    #15 0x7f9df9a15cf4 in main (#3) file:///b/s/w/ir/tests/standalone/regress_52715_test.dart:15
    #16 0x7f9df99cca51 in _SuspendState._createAsyncCallbacks.thenCallback dart:async-patch/async_patch.dart:195
    #17 0x7f9df996027f in _RootZone.runUnary dart:async/zone.dart:1661
    #18 0x7f9df9a15464 in _SuspendState._awaitCompletedFuture.run dart:async-patch/async_patch.dart:248
    #19 0x7f9df99c6796 in _microtaskLoop dart:async/schedule_microtask.dart:40
    #20 0x7f9df99c6655 in _startMicrotaskLoop (#2) dart:async/schedule_microtask.dart:49
    #21 0x7f9df99c661e in _startMicrotaskLoop dart:async/schedule_microtask.dart
    #22 0x7f9df996ef91 in _runPendingImmediateCallback dart:isolate-patch/isolate_patch.dart:123
    #23 0x7f9df996ef30 in _RawReceivePort._handleMessage dart:isolate-patch/isolate_patch.dart:190
    #24 0x7f9df995c5a0 in stub InvokeDartCode /b/s/w/itj2kfje23/cc2p0ZTr.o
    #25 0x55a56a78f405 in dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&) out/ReleaseASANX64/../../runtime/vm/dart_entry.cc:138:33
    #26 0x55a56a7943d1 in dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&) out/ReleaseASANX64/../../runtime/vm/dart_entry.cc:37:10
    #27 0x55a56a7943d1 in dart::DartLibraryCalls::HandleMessage(long, dart::Instance const&) out/ReleaseASANX64/../../runtime/vm/dart_entry.cc:731:28
    #28 0x55a56a7f0921 in dart::IsolateMessageHandler::HandleMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message>>) out/ReleaseASANX64/../../runtime/vm/isolate.cc:1308:15
    #29 0x55a56a814a1f in dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) out/ReleaseASANX64/../../runtime/vm/message_handler.cc:239:16
    #30 0x55a56a81607c in dart::MessageHandler::TaskCallback() out/ReleaseASANX64/../../runtime/vm/message_handler.cc:458:18
    #31 0x55a56ab57695 in dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) out/ReleaseASANX64/../../runtime/vm/thread_pool.cc:158:15
    #32 0x55a56ab58aaa in dart::ThreadPool::Worker::Main(unsigned long) out/ReleaseASANX64/../../runtime/vm/thread_pool.cc:330:9
    #33 0x55a56aa05022 in dart::ThreadStart(void*) out/ReleaseASANX64/../../runtime/vm/os_thread_linux.cc:154:5
    #34 0x7f9dfcde4608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8

SUMMARY: AddressSanitizer: 180 byte(s) leaked in 9 allocation(s).

--- Re-run this test:
python3 tools/test.py -n vm-aot-asan-linux-release-x64 standalone/regress_52715_test
@vsmenon vsmenon added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jun 29, 2023
copybara-service bot pushed a commit that referenced this issue Jun 29, 2023
…oad.

Bug: #52816
Change-Id: I4e50180a9285727cc2e275dd17dd6855f21a0b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311926
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
@mkustermann
Copy link
Member

/cc @mraleph

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. library-io
Projects
None yet
Development

No branches or pull requests

3 participants