[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106885] [Ruby master Bug#18446] LSAN reporting
From:
"peterzhu2118 (Peter Zhu)" <noreply@...>
Date:
2021-12-29 00:42:40 UTC
List:
ruby-core #106885
Issue #18446 has been updated by peterzhu2118 (Peter Zhu). These leaks are "real" in the sense that they appear to the tool (ASAN/Valgrind) as real leaks because they aren't freed. The reason they're not freed is because the system will reclaim all the memory after the Ruby process terminates anyways, so freeing this memory at shutdown is extra work that is not needed (which will slow down Ruby's shutdown). There currently is no way to make Ruby clean everything up during shutdown, but this could perhaps be a feature in a future version of Ruby. As @ufuk has pointed out, you can use ruby_memcheck for native gems. I haven't had good success with Valgrind on macOS either. I use the tool on Linux. If you're able to get LSAN working with ruby_memcheck, please submit a PR and I'll review it! ---------------------------------------- Bug #18446: LSAN reporting https://bugs.ruby-lang.org/issues/18446#change-95691 * Author: ibylich (Ilya Bylich) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0dev (2021-12-27T13:57:46Z master be476f38f9) [x86_64-darwin20] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- ASAN ships with LSAN (LeakSANinitizer) that (if compiled with ASAN) can be enabled by adding `ASAN_OPTIONS=detect_leaks=1` env variable. As I know it can also be injected dynamically via `LD_PRELOAD`/`DYLD_INSERT_LIBRARIES` on Linux/Mac. Currently it reports a bunch of memory leaks of different sizes: ``` ... 1 kilometer of leaks ... SUMMARY: AddressSanitizer: 540806 byte(s) leaked in 11450 allocation(s). ``` First of all, are these leaks real? valgrind also reports them. If they are not real, is there a way to make LSAN ignore them? As I know MRI uses ASAN programmatically in many place (like in `gc.h`) to poison (i.e. "mark"?) some memory areas, and so my hunch is that these leaks are false-positive. Then, is it possible to "fix" reporting? I'm asking because it'd be very useful for native extensions development, ASAN+LSAN is a good combo to find and unroll segfaults and memory leaks, but LSAN is barely usable right now. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>