-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ffmpeg: segfault on x86 CPUs with less instruction features. #8686
Comments
https://github.com/openwrt/packages/blob/master/multimedia/ffmpeg/Makefile#L484 |
Thanks for the tip. However, it's doesn't work. I've updated my OP to include this test. An unrelated side note: |
Does ffmpeg work or does it also segfault? |
ffmpeg also segfault. |
Hmm... If you do a debug build you could use gdb and hopefully figure out why it segfaults. Additionally depending on how much you want to spend on this you could try my ffmpeg4 branch which slightly changes the way ffmpeg is being built although I doubt that's the cause. The last commit is untested but "it should work"(TM). |
I'll just mention that ffmpeg on i486_pentium does not compile: https://downloads.openwrt.org/snapshots/faillogs/i386_pentium/packages/ffmpeg/full/compile.txt The issue is that the nasm binary built as part of the toolchain is not assembling correctly. objdump and strip give unrecognized format errors. The simplest fix would be to disable x86asm for the legacy x86 target. |
@neheb @diizzyy As for the time to spend, I am just an ffmpeg user and happy addicted OpenWRT snapshot tester. And I think my use case and environment combination are unpopular, if not rare among OpenWRT users. The present situation in no way will jeopardize my daily operation, for I have a working good old version in hand, and more, since I started to try virtualizing OpenWRT on nodes and cluster, it does not necessarily confine the use of ffmpeg on OpenWRT. If someday my needs call for a newer version of ffmpeg, a container of some distro with working ffmpeg builds would be an easy alternative. I tried reading through commits of upstream ffmpeg repo, but the effort seems to be prohibitive for me. It will take time, but I am not in a hurry. Maybe before I solve this mystery, the old hardware will eventually be phased out and the problem solves itself. |
@DazzyWalkman |
@diizzyy I notice you may have disabled some rare used modules to shrink the total package(s) size from 8.5 mega bytes of 3.4.6 full to 4.6 megabytes of ffmpeg4. Other things have happened before this test:
I have not tested if 3.4.6 clean built under these circumstances also works ok yet. So I'd like to leave this issue open for now, until some further tests conducted. It is nice to be back on track with latest ffmpeg, and do not have to stay with the soon-to-be-EOL 3.2 branch. Thank you. |
@DazzyWalkman The idea is to only include what you'd normally need in one of these scenarios:
...and somehow try to fit all this into "one size fits all" to avoid a zillion of variants and options ;-) |
There is no change of situation concerning ffmpeg 3.4.6. |
@DazzyWalkman |
As of diizzyy@0ea14d0 |
Thanks, I added ffprobe and png because you asked about it last time ;-) |
@DazzyWalkman |
Maintainer: @thess
Environment: x86_64,, OpenWrt snapshot r9874
Description:
The following code:
ffprobe ./test.avi
will generate a segfault:
kern.info kernel: [49036.983202] ffprobe[28883]: segfault at 7f693b4de320 ip 00007f693a891317 sp 00007ffcc5547330 error 7 in libavcodec.so.57.107.100[7f693a870000+8cb000]
in syslog and program aborts.
It appears since
295f6b3
ffmpeg: update to 3.4.5
Previous version 3.2.12 works flawlessly.
BUILD_PATENTED true or false does not matter, and whatever codecs of test.avi do not seem to matter either.
Tests I have run so far reveal that It may be related to the CPU type on which OpenWRT is running,
particularly to SSE4 support.Works on Sandybridge, Hasswell, Segfault on Atom D525 or kvm64.
Real world impacts for me:
I don't know if it's a new requirement imposed by newer versions of ffmpeg, or there are related build flags.
Modifying Makefile to disable asm or any instructions newer than ssse3 does not work.
And in fact ffmpeg already enables 'runtime-cpudetection' as default.
At present I stick to ffmpeg 3.2.12 on the affected platform.
Update:
I tried compiling a build with --CPU=nocona, as suggested by @diizzyy. The CPU flag is quite close to D525. Still segfault.
Compiled on a Ubuntu 18.10 Virtualbox guest with CPU as host:
Intel(R) Pentium(R) CPU G640
(Sandy Bridge).Test run on Virtualbox OpenWRT guest with CPU as host: G640 : Works.
Test run on QEMU OpenWRT guest with CPU as host:
Intel(R) Celeron(R) CPU J1900
(Bay Trail): Segfault.Version String:
ffprobe version 3.4.6 Copyright (c) 2007-2019 the FFmpeg developers
built with gcc 8.3.0 (OpenWrt GCC 8.3.0 r9482-b2bf3745ff)
configuration: --enable-cross-compile --cross-prefix=x86_64-openwrt-linux-musl- --arch=x86_64 --cpu=nocona --target-os=linux --prefix=/usr --pkg-config=pkg-config --enable-shared --enable-static --enable-pthreads --enable-zlib --disable-doc --disable-debug --disable-lzma --disable-vaapi --disable-vdpau --disable-outdevs --enable-lto --enable-x86asm --enable-avresample --enable-hardcoded-tables --enable-libmp3lame
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
I compared flags of G640 and J1900, not so much difference. It's not an SSE4 issue as I formerly speculated.
The text was updated successfully, but these errors were encountered: