Please pass --enable-redirect-malloc to ./configure when building libgc.so. Without it, the library cannot be used as a drop-in runtime malloc() replacement and LD_PRELOAD=/usr/lib/libgc.so.1:/usr/lib/libgccpp.so.1 GC_PRINT_STATS=1 foobar does not work as advertised.