Open rmacnak-google opened 4 years ago
The puzzling thing is that global C++ state should be treated as strong roots by the leak sanitizer and therefore everything (transitively) reachable from it should not be considered as leaks. See lsan design doc
So I would assume the global thread pool, various global mutexes/monitors and global lists are treated as roots. One of those roots is a global list of isolate groups, each of which has a list of isolates. So all those resources should not be considered as leaks.
Thanks for the pointer, I had misunderstood LSAN as wanting everything to have been freed before exit.
dart:io's exit call's libc's exit without first calling Dart_Cleanup. This can cause TSAN to complain about leaks of VM thread pool threads. Ideally we would inform TSAN that when we exit this way we don't care about leaks (and likewise for LSAN), but there doesn't appear to be a way to set TSAN's report_thread_leaks at runtime. We don't want completely ignore thread leak reportings because it is useful when we shutdown gracefully (main isolate completes its message and has no open receive ports).