Bug 242251

Summary: emulators/qemu-user-static: hangs during multimedia/ffmpeg build on -CURRENT
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-emulation (Nobody) <emulation>
Status: New ---    
Severity: Affects Only Me CC: dnelson_1901, emulation, kevans, multimedia
Priority: --- Keywords: needs-qa
Version: Latest   
Hardware: arm   
OS: Any   

Description Jan Beich freebsd_committer freebsd_triage 2019-11-26 17:10:05 UTC
Affects at least armv6, armv7 and aarch64. However, aarch64 packages are built on real hardware, so pkg-fallout@ is silent.

/nxb-bin/usr/bin/cc -I. -I./ -DLIBICONV_PLUG -isystem /usr/local/include -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -DZLIB_CONST -DHAVE_AV_CONFIG_H -DBUILDING_swresample -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing    -march=armv7-a -std=c11 -fomit-frame-pointer -fPIC -marm -pthread  -I/usr/local/include -I/usr/local/include/p11-kit-1 -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/freetype2 -I/usr/local/include/opus -I/usr/local/include/opus -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -I/usr/local/include -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -Wno-char-subscripts -O3 -fno-math-errno -fno-signed-zeros -mstack-alignment=16 -Qunused-arguments -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type  -MMD -MF libswresample/swresample_frame.d -MT libswresample/swresample_frame.o -c -o libswresample/swresample_frame.o libswresample/swresample_frame.c
sed 's/MAJOR/3/' libswresample/libswresample.v | cat > libswresample/libswresample.ver
/nxb-bin/usr/bin/cc -shared -Wl,-soname,libswresample.so.3 -Wl,-Bsymbolic -Wl,--version-script,libswresample/libswresample.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -fstack-protector-strong -L/usr/local/lib -Wl,-z,notext  -march=armv7-a -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -Qunused-arguments  -o libswresample/libswresample.so.3 libswresample/arm/audio_convert_init.o libswresample/arm/audio_convert_neon.o libswresample/arm/resample.o libswresample/arm/resample_init.o libswresample/audioconvert.o libswresample/dither.o libswresample/log2_tab.o libswresample/options.o libswresample/rematrix.o libswresample/resample.o libswresample/resample_dsp.o libswresample/swresample.o libswresample/swresample_frame.o -lavutil -lavutil -lm -pthread -L/usr/local/lib -lva-drm -lva -lvdpau -lX11 -lm -L/usr/local/lib -lva -pthread -L/usr/local/lib -lva-drm -lva -lvdpau -lX11 -lm -L/usr/local/lib -lva 
cd ./libswresample/ && ln -s -f libswresample.so.3 libswresample.so
=>> Killing runaway build after 21600 seconds with no output
=>> Cleaning up wrkdir

http://beefy8.nyi.freebsd.org/data/head-armv6-default/p518286_s355039/logs/errors/ffmpeg-4.2.1_17,1.log
http://beefy12.nyi.freebsd.org/data/head-armv7-default/p518178_s355024/logs/errors/ffmpeg-4.2.1_16,1.log
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2019-11-26 17:16:36 UTC
(In reply to Jan Beich from comment #0)

Thanks for the report! It seems we still have some threading issues to work out in bsd-user. =-(

We're focusing on getting our branch of qemu-user-static rebased to qemu-3.1 pushed out the door so that riscv64 people can make progress on ports building, then this is likely our highest priority after that.
Comment 2 Dan Nelson 2019-12-21 16:34:07 UTC
Also hangs on mips, so it's not architecture-specific.  The process that hangs in my case is gmake, and that doesn't use threads (unless you mean that qemu-user-static uses threads internally).  A stack trace of the process that qemu-*-static is running would probably be useful, but I don't know how to generate that.