[MMAPI R28.1] Segmentation fault at strlen()

This is MY failure report.
NOT related to nVIDIA MMAPI.


I don’t use strlen() with a pointer variable in my H.264 decoder program.
(Only with literal argument: C type string, I use strlen().)
But it seems that a segmentation fault occurs at strlen().

When code was executed on gdb, this message was displayed.

Thread 7 "RtpRcvDecode" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fad4cd1e0 (LWP 7053)]
strlen () at ../sysdeps/aarch64/strlen.S:92
92      ../sysdeps/aarch64/strlen.S: No such file or directory.

In the MMAPI source, there are strlen()s in only NvEglRenderer.cpp (by grep).
But the argument in this strlen() is array of char of class variable: overlay_str.
It cannot become NULL pointer.

include/NvEglRenderer.h

char overlay_str[512];

samples/common/classes/NvEglRenderer.cpp

memset(overlay_str, 0, sizeof(overlay_str));
if (strlen(overlay_str) != 0)
XDrayString(x_display, x_window, gc, overlay_str_x_offset,
    overlay_str_y_offset, overlay_str, strlen(overlay_str));
strncpy(overlay_str, str, sizeof(overlay_str));
overlay_str ="\0";

My code uses NvVideoDecoder, NvVideoConverter and NvEglRenderer objects.
(Ethernet → TCP/IP socket → Decoder → Converter → Renderer → HDMI Display)
Of couse, I don’t use this overlay function of NvEglRenderer.

Is there another strlen() in the MMAPI (e.g. libtegrav4l2.so) ?

Best Regards

Sorry, its cause maybe be my bug.

My code uses vsprintf()s for debug logs.

It seems that
vsprintf() calls _IO_vfprintf_internal(),
_IO_vfprintf_internal() calls strlen().

I made mistakes about variable type for argument of vsprintf()
(reverse the order of %s and %u)
in error log when it occurs rarely.

Best Regards

Nice! Thanks for the update.