pixop / video-compare

Split screen video comparison tool using FFmpeg and SDL2
GNU General Public License v2.0
969 stars 44 forks source link

Ubuntu compiled program SIGSEGV #66

Closed mesziman closed 5 months ago

mesziman commented 5 months ago

Hi,

I am facing issue on Ubuntu 23.04 steps to reproduce: makefile with necessary edit to -I/usr/lib instead of local. run with the parameters used in test What's the issue? needed more updated libs?

Program received signal SIGSEGV, Segmentation fault. VideoDecoder::VideoDecoder (this=this@entry=0x555555633e60, decoder_name="", hw_accel_spec="", codec_parameters=codec_parameters@entry=0x1900000001) at videodecoder.cpp:9 9 codec = avcodec_find_decoder(codec_parameters->codec_id); (gdb) bt

0 VideoDecoder::VideoDecoder(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, AVCodecParameters*) (this=this@entry=0x555555633e60, decoder_name="", hw_accel_spec="", codec_parameters=codec_parameters@entry=0x1900000001) at video_decoder.cpp:9

1 0x000055555559c343 in std::make_unique<VideoDecoder, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, AVCodecParameters>(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, AVCodecParameters&&) () at /usr/include/c++/12/bits/unique_ptr.h:1064

2 VideoCompare::VideoCompare(int, Display::Mode, bool, bool, bool, std::tuple<int, int>, Display::Loop, unsigned long, double, float, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)

(this=this@entry=0x7fffffffd720, display_number=display_number@entry=0, display_mode=display_mode@entry=Display::split, verbose=<optimized out>, high_dpi_allowed=high_dpi_allowed@entry=false, use_10_bpc=use_10_bpc@entry=false, window_size=std::tuple containing = {...}, auto_loop_mode=Display::off, frame_buffer_size=50, time_shift_ms=time_shift_ms@entry=0, wheel_sensitivity=wheel_sensitivity@entry=1, left_file_name="screenshot_1.jpg", left_video_filters="", left_demuxer="", left_decoder="", left_hw_accel_spec="", right_file_name="screenshot_2.jpg", right_video_filters="", right_demuxer="", right_decoder="", right_hw_accel_spec="", disable_auto_filters=false) at video_compare.cpp:67

3 0x0000555555564f27 in main(int, char**) (argc=5, argv=) at main.cpp:357

jonfryd commented 5 months ago

Hi,

Thanks for the backtrace. Notice that the crash occurs when calling avcodec_find_decoder.

I've not seen this problem before, but maybe someone else can chime in. It might be related to some incompatibility between the FFmpeg include files and the FFmpeg libraries used to build the software.

Check your system for multiple installations of FFmpeg.

mesziman commented 5 months ago

Something like that I guess. I actually compiled ffmpeg from source . So it might interfere. Those headers are in /usr/local and the package installed libavcodec-dev headers are in /usr/x86-64-linux-gnu ... . I will try to play around with includes

mesziman commented 5 months ago

OKay, my mistake probably that the ffmpeg custom build is not fully linked with the desired features. /usr/bin/ld: /usr/local/lib/libavutil.a(hwcontext_vdpau.o): undefined reference to symbol 'XDisplayString'

jonfryd commented 5 months ago

Thanks for the update! Let me know if that fixes it.

jonfryd commented 5 months ago

Can this one be closed, @mesziman?

mesziman commented 5 months ago

I guess it can , did not found a solution. I have rebuild ffmpeg to override everything on my Ubuntu so now all headers and libs are from source , no conflict should be but the issue persist. Maybe I will try a different ffmpeg version

jonfryd commented 5 months ago

Right, I have had issues in the past when building FFmpeg straight from the master branch. Try a tagged version.

Closing this.