oneShot crash on object free with TCMalloc

Hi,
I’m running the Argus sample ‘oneshot’ with TCMalloc (google’s memory allocator) TCMalloc : Thread-Caching Malloc

I’m running one_shot without any modifications, only the addition of TCMalloc.

I get consistent crashes while freeing the Argus streams - is this a bug in the Argus library, perhaps a double-free?

I’m running on a Nano using jetpack 4.3

Stacktrace:
(gdb) where
#0 0x0000007f737404d8 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:51
#1 0x0000007f737418b4 in __GI_abort () at abort.c:79
#2 0x0000000000a354c0 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem) (mode=tcmalloc::kCrash, filename=0xae6e48 “external/com_google_tcmalloc/tcmalloc/tcmalloc.cc”, line=2056, a=…, b=…, c=…, d=…) at external/com_google_tcmalloc/tcmalloc/internal/logging.cc:128
#3 0x0000000000a5dbe8 in TCMallocInternalDeleteSized(void*, size_t) (p=0x1da4487000, size=1) at external/com_google_tcmalloc/tcmalloc/tcmalloc.cc:2056
#4 0x0000007fb1058fb0 in () at /usr/lib/aarch64-linux-gnu/tegra/libnvscf.so
#5 0x0000007fb105907c in () at /usr/lib/aarch64-linux-gnu/tegra/libnvscf.so
#6 0x0000007fb0f7f0e0 in () at /usr/lib/aarch64-linux-gnu/tegra/libnvscf.so
#7 0x0000007fb6be3294 in () at /usr/lib/aarch64-linux-gnu/tegra/libnvargus.so
#8 0x0000000000423a64 in Argus::UniqueObjArgus::OutputStream::reset(Argus::OutputStream*) (this=0x7ffffff250, obj=0x0) at external/local_config_cuda/sys_src_base/jetson_multimedia_api/include/Argus/Types.h:410
#9 0x00000000004235f4 in Argus::UniqueObjArgus::OutputStream::~UniqueObj() (this=0x7ffffff250) at external/local_config_cuda/sys_src_base/jetson_multimedia_api/include/Argus/Types.h:417
#10 0x00000000004223e0 in main(int, char**) (argc=1, argv=0x7ffffff5e8) at logger/one_shot.cc:202

It’s could be the camera stack have internal DMA memory not support tcmalloc.

the size parameter of 1 looks interesting, not sure what we would be freeing with that size.

“external/com_google_tcmalloc/tcmalloc/tcmalloc.cc”, line=2056, a=…, b=…, c=…, d=…) at external/com_google_tcmalloc/tcmalloc/internal/logging.cc:128
#3 0x0000000000a5dbe8 in TCMallocInternalDeleteSized(void*, size_t) (p=0x1da4487000, size=1) at external/com_google_tcmalloc/tcmalloc/tcmalloc.cc:2056