This is kind of horrible, but it seems to work and I can't currently think of any better way ... I verified that it does actually set the right environment variables and invoke the malloc checking behaviour in glibc 2.34. I didn't test it yet with glibc < 2.34 or !glibc. Rich.