Some issue in configure.ac or Makefile.am.
In the related issue, a memory leak was found in simulate_mode.c. ASAN stack trace is useless while valgrind works.
$ ./autogen.sh --enable-debug
$ make CFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address"
$ sudo make install
$ sudo /var/cfengine/bin/cf-agent -KI test.cf --simulate=diff
warning: All changes in files will be made in the '/var/cfengine/state/5989.changes' chroot
info: Updated content of '/tmp/hello-world' with content 'Hello, world!
warning: No action was requested for file '/tmp/hello-world'. Maybe a typo in the policy?
info: files promise '/tmp/hello-world' repaired
info: Showing diff for changed files (in the changes chroot)
--- original /tmp/hello-world
+++ changed /tmp/hello-world
@@ -1 +1 @@
==5989==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 168 byte(s) in 1 object(s) allocated from:
#0 0x557550beba2e in __interceptor_realloc (/var/cfengine/bin/cf-agent+0x12ba2e)
#1 0x7f57280a5d88 (/lib/x86_64-linux-gnu/libc.so.6+0x8ed88)
SUMMARY: AddressSanitizer: 168 byte(s) leaked in 1 allocation(s).
Reintroduce the memory leak to reproduce the bad stack trace.