Why are all Argus object interfaces detected as "invalid vptr" by GCC memory sanitizer?

Hello! I’ve been profiling my C++ program, which is running on TX2NX, and I noticed that each and every interface pointer is detected as “invalid vptr” by the GCC memory sanitizer. What does it exactly mean and why is that?

...

/development/app/debug/src/test.cpp:449:53: runtime error: member call on address 0x007f48c646f0 which does not point to an object of type 'ICaptureSession'
0x007f48c646f0: note: object has invalid vptr
 00 00 00 00  38 cd 15 b4 7f 00 00 00  b8 cd 15 b4 7f 00 00 00  10 2b bf 7b 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:62: runtime error: member call on address 0x007f7bbf2b00 which does not point to an object of type 'InterfaceProvider'
0x007f7bbf2b00: note: object has invalid vptr
 00 00 00 00  c0 c9 15 b4 7f 00 00 00  00 ca 15 b4 7f 00 00 00  18 ca 15 b4 7f 00 00 00  f8 d8 18 b4
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:12: runtime error: downcast of address 0x007f48c646f0 which does not point to an object of type 'ICaptureSession'
0x007f48c646f0: note: object has invalid vptr
 00 00 00 00  38 cd 15 b4 7f 00 00 00  b8 cd 15 b4 7f 00 00 00  10 2b bf 7b 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/development/app/debug/src/camera/capture.cpp:173:49: runtime error: member call on address 0x007f48c646f0 which does not point to an object of type 'ICaptureSession'
0x007f48c646f0: note: object has invalid vptr
 00 00 00 00  38 cd 15 b4 7f 00 00 00  b8 cd 15 b4 7f 00 00 00  10 2b bf 7b 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:62: runtime error: member call on address 0x007f7cfbad80 which does not point to an object of type 'InterfaceProvider'
0x007f7cfbad80: note: object has invalid vptr
 00 00 00 00  50 c3 15 b4 7f 00 00 00  98 c3 15 b4 7f 00 00 00  d8 c3 15 b4 7f 00 00 00  01 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:12: runtime error: downcast of address 0x007f7cfbadb0 which does not point to an object of type 'IFrameConsumer'
0x007f7cfbadb0: note: object has invalid vptr
 7f 00 00 00  98 c4 15 b4 7f 00 00 00  d9 68 42 47 7f 00 00 00  d0 0b 02 47 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/development/app/debug/src/camera/capture.cpp:287:54: runtime error: member call on address 0x007f7cfbadb0 which does not point to an object of type 'IFrameConsumer'
0x007f7cfbadb0: note: object has invalid vptr
 7f 00 00 00  98 c4 15 b4 7f 00 00 00  d9 68 42 47 7f 00 00 00  d0 0b 02 47 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:62: runtime error: member call on address 0x007f7cfbb5c0 which does not point to an object of type 'InterfaceProvider'
0x007f7cfbb5c0: note: object has invalid vptr
 00 00 00 00  58 c9 15 b4 7f 00 00 00  90 c9 15 b4 7f 00 00 00  f8 d8 18 b4 7f 00 00 00  80 00 44 7c
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:12: runtime error: downcast of address 0x007f48c64720 which does not point to an object of type 'ISensorMode'
0x007f48c64720: note: object has invalid vptr
 00 00 00 00  80 da 15 b4 7f 00 00 00  f0 da 15 b4 7f 00 00 00  c8 b5 fb 7c 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/development/app/debug/src/camera/capture.cpp:300:88: runtime error: member call on address 0x007f48c64720 which does not point to an object of type 'ISensorMode'
0x007f48c64720: note: object has invalid vptr
 00 00 00 00  80 da 15 b4 7f 00 00 00  f0 da 15 b4 7f 00 00 00  c8 b5 fb 7c 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:62: runtime error: member call on address 0x007f7cfbb5c0 which does not point to an object of type 'InterfaceProvider'
0x007f7cfbb5c0: note: object has invalid vptr
 00 00 00 00  58 c9 15 b4 7f 00 00 00  90 c9 15 b4 7f 00 00 00  f8 d8 18 b4 7f 00 00 00  80 00 44 7c
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:380:12: runtime error: downcast of address 0x007f48c64720 which does not point to an object of type 'ISensorMode'
0x007f48c64720: note: object has invalid vptr
 00 00 00 00  80 da 15 b4 7f 00 00 00  f0 da 15 b4 7f 00 00 00  c8 b5 fb 7c 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/development/app/debug/src/camera/capture.cpp:301:90: runtime error: member call on address 0x007f48c64720 which does not point to an object of type 'ISensorMode'
0x007f48c64720: note: object has invalid vptr
 00 00 00 00  80 da 15 b4 7f 00 00 00  f0 da 15 b4 7f 00 00 00  c8 b5 fb 7c 7f 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
[New Thread 0x7f44f7df90 (LWP 11822)]
[New Thread 0x7f363e2f90 (LWP 11828)]
/usr/src/jetson_multimedia_api/argus/include/Argus/Types.h:447:99: runtime error: member call on address 0x007f4795b848 which does not point to an object of type 'Destructable'
0x007f4795b848: note: object has invalid vptr
 7f 00 00 00  00 ca 15 b4 7f 00 00 00  18 ca 15 b4 7f 00 00 00  f8 d8 18 b4 7f 00 00 00  e0 ac f5 7c
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr

...

P. S. This code is much longer but it’s basically the same - it’s for each interface pointer

Hi,
Please share how to do GCC memory sanitizer and we will check it on later release.

For Jetpack 4, do you see any issue while using Argus? Jetpack 4.6.4 shall be stable, although this error is reported. Not sure if you are experiencing any issue. If there is no servere failure, it should be fine to ignore the error.

Hello, sorry for the late response.

I am not noticing any issue for Argus - it’s just when you’re trying to code really clean and well maintained code, this isn’t something that’s nice to see.

How to replicate this:
Just compile any program, which runs camera using Argus (examples work as well), in Debug mode, with -fsanitize=address -fsanitize=undefined flags set. When you launch the program via terminal, these runtime_error’s will print when accessing something via Interface or destroying with Destructor