Nvjpegdecodec Segmentation fault

[INFO] [ecat_producer.cpp:224] Added random noise to JPEG data
[WARN] [ecat_producer.cpp:320] Frame 129: Sending corrupted JPEG data (original: 46513 bytes, corrupted: 46513 bytes)
Error: Parsing of stream failed
[DEBUG] [JpegDecoder.cpp:216] libjpeg-turbo JPEG comp_info: v_samp=2 h_samp=2
Error: Cannot decode JPEG header
Error: Cannot decode JPEG header
Thread 1 "test_ecat_ipc" received signal SIGSEGV, Segmentation fault.

#0  0x0000ffffef2f874c in ?? () from /usr/lib/aarch64-linux-gnu/nvidia/libnvmm_jpeg.so
#1  0x0000ffffef2c2068 [PAC] in jpeg_read_raw_data () from /usr/lib/aarch64-linux-gnu/nvidia/libnvmm_jpeg.so

您好,我使用jetson_mutimedia_api时发现。sample:06_jpeg_decode :我传入一个格式被破坏的jpeg数据时,jpeg_read_header()函数会报错”Error: Parsing of stream failed”,但是程序捕获不到这个错误。紧接着在jpeg_read_raw_data函数内部就出现段错误。

我手动设置了cinfo.err的处理机制,还是捕捉不到这个错误,这样会导致我程序只要遇到错误的jpeg程序就会崩溃。

    m_cinfo.err = jpeg_std_error(&m_jerr.pub);
    m_jerr.pub.error_exit = rcu_jpeg_error_exit;
    m_jerr.pub.emit_message = rcu_jpeg_emit_message;

请帮我分析原因,我如何避免因为错误的文件格式而导致程序崩溃?

Hi,
Please attach the JPEG file and share the command of running 06 sample. We will set up AGX Thor developer kit and check.

robot@tegra:/usr/src/jetson_multimedia_api/samples/06_jpeg_decode$ ./jpeg_decode num_files 1 ~/sent_frame_167.jpg ~/output.nv12
Error: Parsing of stream failed
Error: Cannot decode JPEG header
Error: Cannot decode JPEG header
Segmentation fault (core dumped)

Hi,

Please backup original and replace it with attached shared library under the /usr/lib/aarch64-linux-gnu/nvidia/ .

Below is the sha256sum value

sha256sum libnvmm_jpeg.so                                  
4292233ad866cc01b378546be1a724b52c5a7d53bc1c9b0fcc78ebb43619f55e  libnvmm_jpeg.so

r38_4_TEST_libnvmm_jpeg_1.zip (389.4 KB)

Thanks

Hi @chutianwei ,

If the attached library works well, please mark the solution ✅ and we could close the topics.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.