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

dart:io memory leaks #34724

Closed
rmacnak-google opened this issue Oct 9, 2018 · 5 comments
Closed

dart:io memory leaks #34724

rmacnak-google opened this issue Oct 9, 2018 · 5 comments
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

standalone_2/io/file_test
standalone_2/io/http_server_response_test
standalone_2/io/signals_test
lib_2/isolate/non_fatal_exception_in_timer_callback_test/sleep

@rmacnak-google rmacnak-google added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io labels Oct 9, 2018
@dcharkes
Copy link
Contributor

dcharkes commented Oct 9, 2018

Tests failing due to memory leaks in vm-kernel-asan-linux-release-x64:

dartk-vm release_x64 lib_2/mirrors/dynamic_load_test
dartk-vm release_x64 standalone_2/io/http_server_response_test (4x)
dartk-vm release_x64 standalone_2/io/test_extension_fail_test
dartk-vm release_x64 standalone_2/io/file_test

dart-bot pushed a commit that referenced this issue Oct 9, 2018
Change-Id: I2b6d03bed48a1d867f95a4c5754d77c7558ae2c6
Reviewed-on: https://dart-review.googlesource.com/c/78780
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
dart-bot pushed a commit that referenced this issue Oct 9, 2018
Bug: #32187
Bug: #34724
Change-Id: I123549194670fa5471a187bfcc5e70fd97efc2ee
Reviewed-on: https://dart-review.googlesource.com/c/78706
Reviewed-by: Ben Konyi <bkonyi@google.com>
@mkustermann
Copy link
Member

mkustermann commented Oct 26, 2018

For the future: When gardening and filing issues, please add as much information as possible:

  • a link to the buildbot failure
  • a copy of the failure (since the link will not work after a certain period of time)
  • what action was taken (e.g. was it debugged?, ...) except for filing an issue and updating the status file

At least one of these leaks are due to:

==31178==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:

STDERR :     #0 0x55fe9504cbe2 in operator new(unsigned long) /b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:92:3
    #1 0x55fe95e8e7e8 in dart::VirtualMemory::AllocateAligned(long, long, bool, char const*) ../../out/DebugX64/../../runtime/vm/virtual_memory_linux.cc:89:10
    #2 0x55fe9644dd8f in dart::HeapPage::Allocate(long, dart::HeapPage::PageType, char const*) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:63:27
    #3 0x55fe9644dd8f in dart::PageSpace::AllocatePage(dart::HeapPage::PageType) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:231
    #4 0x55fe964509ce in dart::PageSpace::TryAllocateInFreshPage(long, dart::HeapPage::PageType, dart::PageSpace::GrowthPolicy, bool) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:378:22
    #5 0x55fe9645f877 in dart::PageSpace::TryAllocateDataBumpInternal(long, dart::PageSpace::GrowthPolicy, bool) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:1211:14

STDERR :     #6 0x55fe9645fbb0 in dart::PageSpace::TryAllocateDataBumpLocked(long, dart::PageSpace::GrowthPolicy) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:1249:10
    #7 0x55fe9645fbb0 in dart::PageSpace::TryAllocatePromoLocked(long, dart::PageSpace::GrowthPolicy) ../../out/DebugX64/../../runtime/vm/heap/pages.cc:1261

STDERR :     #8 0x55fe9647bce5 in dart::ScavengerVisitor::ScavengePointer(dart::RawObject**) ../../out/DebugX64/../../runtime/vm/heap/scavenger.cc:150:26
    #9 0x55fe9647bce5 in dart::ScavengerVisitor::VisitPointers(dart::RawObject**, dart::RawObject**) ../../out/DebugX64/../../runtime/vm/heap/scavenger.cc:86

STDERR :     #10 0x55fe96474979 in long dart::RawObject::VisitPointersNonvirtual<dart::ScavengerVisitor>(dart::ScavengerVisitor*) ../../out/DebugX64/../../runtime/vm/raw_object.h:589:17

STDERR :     #11 0x55fe96474350 in dart::Scavenger::IterateStoreBuffers(dart::Isolate*, dart::ScavengerVisitor*) ../../out/DebugX64/../../runtime/vm/heap/scavenger.cc:577:19

STDERR :     #12 0x55fe96474e9f in dart::Scavenger::IterateRoots(dart::Isolate*, dart::ScavengerVisitor*) ../../out/DebugX64/../../runtime/vm/heap/scavenger.cc:618:5

STDERR :     #13 0x55fe96479c6a in dart::Scavenger::Scavenge() ../../out/DebugX64/../../runtime/vm/heap/scavenger.cc:938:5

STDERR :     #14 0x55fe96434be4 in dart::Heap::CollectNewSpaceGarbage(dart::Thread*, dart::Heap::GCReason) ../../out/DebugX64/../../runtime/vm/heap/heap.cc:415:18

STDERR :     #15 0x55fe96434695 in dart::Heap::NotifyIdle(long) ../../out/DebugX64/../../runtime/vm/heap/heap.cc:376:5

STDERR :     #16 0x55fe958bc607 in dart::MessageHandler::CheckAndRunIdleLocked(dart::MonitorLocker*) ../../out/DebugX64/../../runtime/vm/message_handler.cc:526:16

STDERR :     #17 0x55fe958b9b9f in dart::MessageHandler::TaskCallback() ../../out/DebugX64/../../runtime/vm/message_handler.cc:430:29

STDERR :     #18 0x55fe958bfc89 in dart::MessageHandlerTask::Run() ../../out/DebugX64/../../runtime/vm/message_handler.cc:27:15

STDERR :     #19 0x55fe95e40b23 in dart::ThreadPool::Worker::Loop() ../../out/DebugX64/../../runtime/vm/thread_pool.cc:381:11
    #20 0x55fe95e3fa38 in dart::ThreadPool::Worker::Main(unsigned long) ../../out/DebugX64/../../runtime/vm/thread_pool.cc:436:27
    #21 0x55fe95b827bd in dart::ThreadStart(void*) ../../out/DebugX64/../../runtime/vm/os_thread_linux.cc:131:5
    #22 0x7f18f50d5493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)

SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).

@mkustermann
Copy link
Member

I suspect this has to do with the idle notification implementation: the main thread might be in the process of shutting down while the idle notification task is doing a scavenge

The test failure is timing dependent, but it can be reproduced locally (ensure to have built with asan)

@mkustermann
Copy link
Member

Since this might be the same root cause as #34888 I'm tentatively assinging @rmacnak-google . Hope that's ok.

dart-bot pushed a commit that referenced this issue Oct 26, 2018
Issue #34724

Change-Id: Ia61386939fbb98ae0142c258ae984dd235262fdd
Reviewed-on: https://dart-review.googlesource.com/c/81606
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
@rmacnak-google rmacnak-google removed their assignment Feb 20, 2019
@a-siva
Copy link
Contributor

a-siva commented Aug 20, 2021

The leak in file_test is being tracked in #40648

Looks like standalone_2/io/signals_test was fixed in another CL.

I cannot reproduce the failures in
standalone_2/io/http_server_response_test
lib_2/isolate/non_fatal_exception_in_timer_callback_test/sleep

and finally dartk-vm release_x64 lib_2/mirrors/dynamic_load_test - dart:mirrors is not being actively maintained

I am closing this issue. If any of the tests in the list do show up with leaks please open new issues with logs that have the error stack trace.

@a-siva a-siva closed this as completed Aug 20, 2021
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

4 participants