You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nim c --cc:clang --noMain --noLinking --header:fib.h -d:danger --gc:arc -d:usemalloc --panics:on -d:nosignalhandler fib.nim
clang -o m -I$HOME/.cache/nim/fib_r -Ipath/to/Nim/lib $HOME/.cache/nim/fib_r/*.c -fsanitize=leak maths.c
Btw I can't make leak sanitizer to detect this (even with -d:useMalloc), but it seems pretty obvious that global resources acquired in NimMain are never freed.
Possible Solution
Should there be a NimExit proc to be called manually at the end that handles destructions, unhandled exceptions... ?
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-06-14
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 2d34b1f5bc45a180d1b53d6c24857133859a4f46
active boot switches: -d:release --gc:markAndSweep
The text was updated successfully, but these errors were encountered:
Similar issue to #18215 but in regards to global objects
Example
Compile with:
Btw I can't make leak sanitizer to detect this (even with -d:useMalloc), but it seems pretty obvious that global resources acquired in NimMain are never freed.
Possible Solution
Should there be a
NimExit
proc to be called manually at the end that handles destructions, unhandled exceptions... ?The text was updated successfully, but these errors were encountered: