Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L4T 5.1 missing return statement in encoder causing segmentation fault #127

Open
bmegli opened this issue Mar 16, 2023 · 3 comments
Open

Comments

@bmegli
Copy link

bmegli commented Mar 16, 2023

L4T version

After flashing L4T 35.1 with SDK Manger

cat /etc/nv_tegra_release 
# R35 (release), REVISION: 2.1, GCID: 32413640, BOARD: t186ref, EABI: aarch64, DATE: Tue Jan 24 23:38:33 UTC 2023
apt-cache show nvidia-l4t-core

Package: nvidia-l4t-core
Version: 35.2.1-20230124153320

hardware

AGX Orin 32 GB

jetson-ffmpeg version

From fork:

FFmpeg version

n4.2.7 (git tag)

build

Building jetson-ffmpeg for release

# ...
cmake -DCMAKE_BUILD_TYPE=Release ..
make
# ...

symptoms

On closing encoder:

  • a series of messages
    • Error while dequeing buffer from output plane
  • followed by segmentation fualt

previous behavior

FWIW this does not happen for me in L4T 34.1.

But that's just C and C++ UB (Undefined Behavior)

@bmegli
Copy link
Author

bmegli commented Mar 16, 2023

Fix

Obviously add missing return statement like here

bmegli added a commit to Extend-Robotics/jetson-ffmpeg that referenced this issue Mar 16, 2023
- dec_capture_loop_fcn is declared as returning void pointer
- but it was never meant to return anything

In L4T 5.1 and release build of jetson-ffmpeg it is enough to:
- cause a segmentation fault during decoding

Related to:
- jocover#127
@bmegli
Copy link
Author

bmegli commented Mar 16, 2023

Similar problem manifests in decoder's

  • void *dec_capture_loop_fcn(void *arg)
  • function was by mistake declared as returning void pointer
  • but it returns nothing

This is UB. In release build and with versions as stated above it also leads to segmentation fault (this time during decoding).

The fix is to declare function as returning void correctly

@eusoubrasileiro
Copy link

@bmegli thank you for pointing another repo more updated.
Found also this https://github.com/Keylost/jetson-ffmpeg
Would be nice I there could be an updated version here instead of multiple branches. Thank you so much regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants