[#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:106887] [Ruby master Bug#18446] LSAN reporting
From:
"peterzhu2118 (Peter Zhu)" <noreply@...>
Date:
2021-12-29 03:09:43 UTC
List:
ruby-core #106887
Issue #18446 has been updated by peterzhu2118 (Peter Zhu). I think a CLI flag would be the best approach. I think this would be a very useful feature because it would (a) allow Ruby to have a CI pipeline that runs LSAN/Valgrind to find and prevent memory leaks, and (b) give native extensions that ability to find leaks without using a "hacky" gem like ruby_memcheck (which results in both false positives and false negatives). I think supporting (b) will also require more work because we would need to add something to the C API to free memory allocated in the native extension (e.g. `Destruct_my_native_ext` that frees memory allocated in `Init_my_native_ext`). This feature would likely require a bit of work because there are objects that are not designed to ever be freed so considerations for such were not made. In order to implement this feature we would need to: 1. Free all objects in allocated through the garbage collector. 2. Free all other allocated memory (e.g. in the Ruby VM). I am very much for having this feature. You (or anyone else reading this) are welcome to try to tackle this challenge :) ---------------------------------------- Bug #18446: LSAN reporting https://bugs.ruby-lang.org/issues/18446#change-95693 * 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>