OE4T/meta-tegra

libv4l2_nvvidconv plugin segmentation fault on VIDIOC_STREAMOFF

madisongh opened this issue · 1 comments

Describe the bug
Initially raised in this discussion.

On OE4T builds, the libv4l2_nvvidconv V4L2 plugin will crash with a segmentation fault when it is passed a VIDIOC_STREAMOFF ioctl when the stream is already off.

This behavior is not seen in the stock L4T Ubuntu distro due to a long-standing Debian downstream patch that allows a null thread ID to be passed to pthread functions. However, this is likely a bug in the plugin itself, since passing an invalid thread ID to pthread_join() invokes "undefined behavior" per the POSIX specifications.

This is known to be an issue with R32.4.x, L4T R32.5.x, and R32.6.x.

To Reproduce
Steps to reproduce the behavior:

  1. Build an image with tegra-demo-distro that includes tegra-mmapi-samples
  2. On the target, run the jpeg_decode sample program (see below)
  3. The sample program sucessfully generates the output file, then terminates with a segmentation fault.

Additional context
To invoke the sample program:

$ /opt/tegra-mmapi/bin/jpeg_decode num_files 1 /opt/tegra-mmapi/data/Picture/nvidia-logo.jpg /tmp/nvidia-logo.yuv

#786 contains a workaround shim for the plugin that prevents the second STREAMOFF from being applied. That went into master, and has now been back-ported to hardknott, dunfell, dunfell-l4t-r32.5.0, and dunfell-l4t-r32.4.3.