-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
GC Memory leak #4617
Comments
If to use -betterC switch then leak disappears echo "extern(C) int main() { return 0; }" > test.d
ldc test.d -betterC
valgrind ./test Outputs:
|
and sanitizers? (address, memory, thread) |
Havent tested, not sure how to though |
Try: $> export ASAN_OPTIONS=abort_on_error=0:fast_unwind_on_malloc=0:detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1
$> ldc2 hello.d -fsanitize=memory
$> ./hello
## Output empty/none or stacktrce? Reference |
Nothing |
|
These are probably just harmless little leaks in upstream druntime, where nobody bothered cleaning up a few bytes. E.g., for
See https://github.com/dlang/dmd/blob/274eec89f4ce7f34a1776e3ac1b1e9c82de90811/druntime/src/core/internal/gc/impl/conservative/gc.d#L142 - that |
Does this leak occur on another system and/or libc? |
I have no way of checking other platforms Also not sure about libc, like, what I do with it? |
I cited libc because Alpine uses musl and not glibc. If you have docker installed, you can test it: docker-ldc2# ldc2 master - upstream (musl fixed)
$ docker pull kassany/alpine-ldc2
$ docker run --rm -it -v $(pwd):/app -w /app kassany/alpine-ldc2:latest ash
# for musl can build `ldc2/ldmd2 -static foo.d` (libunwind-static already installed)
# run valgrind (your host) in static-foo. |
OS info
OS: Arch Linux
LDC: v1.37.0
Steps to reproduce
Valgrind trace
Short (no --leak-check=full)
Full (click me)
The text was updated successfully, but these errors were encountered: