Programs linked with ASAN report memory leaks when building with GHC 8.6, but not with 8.4
Summary
I needed to run some ASAN-enabled code and had to link with libasan
. After switching to GHC 8.6 it started to fail my CI builds with post-exit leaks:
$ stack exec lasange-exe
someFunc
=================================================================
==6010==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0x7f4850641f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30)
#1 0x470bf0 (/home/user/src/lasange/.stack-work/install/x86_64-linux-tinfo6/lts-13.16/8.6.4/bin/lasange-exe+0x470bf0)
SUMMARY: AddressSanitizer: 112 byte(s) leaked in 1 allocation(s).
Steps to reproduce
- Start a new project.
- Add
ld-options: -lasan
to executable. - Run it.
Expected behavior
Normal run with exit code 0.
Environment
- GHC version used: 8.6.4
Optional:
- Operating System: Ubuntu 18.10
- System Architecture: x86_64