Bug 234475

Summary: multimedia/dav1d: Fails self-testing on i386
Product: Ports & Packages Reporter: Mikhail Teterin <mi>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me CC: freebsd-2024
Priority: --- Keywords: needs-qa
Version: LatestFlags: jbeich: maintainer-feedback+
Hardware: i386   
OS: Any   

Description Mikhail Teterin freebsd_committer freebsd_triage 2018-12-28 19:16:37 UTC
I configured the port to automatically perform self-tests after building. The very first of the tests dies from SIGBUS:

....
===>  Staging for dav1d-0.1.0
[1/13] /opt/bin/meson --internal vcstagger ../include/version.h.in include/version.h 0.1.0 /var/ports/multimedia/dav1d/work/dav1d-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72/include @VCS_TAG@ '(.*)' /opt/bin/git --git-dir /var/ports/multimedia/dav1d/work/dav1d-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72/.git describe --tags --long --match '?.*.*' --always
fatal: Not a git repository: '/var/ports/multimedia/dav1d/work/dav1d-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72-a6b903fb6d78f1515b2c50ba17ae50ead8cf5b72/.git'
[1/2] /opt/bin/meson test --no-rebuild --print-errorlogs
  1/855 dav1d / checkasm                        FAIL     0.48 s (killed by signal 10 SIGBUS)
  2/855 dav1d:testdata-8 / 00000000             OK       0.34 s
  3/855 dav1d:testdata-8 / 00000001             OK       1.51 s
....

The other 854 tests succeed.

The stack of the test-program (checkasm), as found in the core-dump, is:

(gdb) where
#0  0x0807170e in cdef_find_dir_c ()
#1  0xdb83381c in ?? ()
#2  0x28119620 in ?? ()
#3  0x00000001 in ?? ()
#4  0x28164f85 in check_deferred_signal (curthread=0x2811a600) at /var/src/lib/libthr/thread/thr_sig.c:324
Previous frame inner to this frame (corrupt stack?)

Dump of assembler code for function cdef_find_dir_c:
0x08071700 <cdef_find_dir_c+0>: push   %ebp
0x08071701 <cdef_find_dir_c+1>: push   %ebx
0x08071702 <cdef_find_dir_c+2>: push   %edi
0x08071703 <cdef_find_dir_c+3>: push   %esi
0x08071704 <cdef_find_dir_c+4>: sub    $0x1cc,%esp
0x0807170a <cdef_find_dir_c+10>:        lds    (bad),%edi
0x0807170b <cdef_find_dir_c+11>:        clc
0x0807170c <cdef_find_dir_c+12>:        push   %edi
0x0807170d <cdef_find_dir_c+13>:        rol    $0xfc,%ch
0x08071710 <cdef_find_dir_c+16>:        sub    %eax,0xe0(%esp)
0x08071717 <cdef_find_dir_c+23>:        lds    (bad),%edi
0x08071718 <cdef_find_dir_c+24>:        cld
0x08071719 <cdef_find_dir_c+25>:        sub    %eax,0xc0(%esp)
0x08071720 <cdef_find_dir_c+32>:        lds    (bad),%esi
0x08071721 <cdef_find_dir_c+33>:        lock push %edi
0x08071723 <cdef_find_dir_c+35>:        leave
...

Forcing the optimization to -O0 -- or simply building WITH_DEBUG -- provides a work-around. This is a FreeBSD-11.2/i386-STABLE machine.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-29 12:24:22 UTC
Any indications of run time failures outside of self tests or issues upstream of a similar nature?
Comment 2 Mikhail T. 2018-12-29 13:19:45 UTC
(In reply to Kubilay Kocak from comment #1)
Nothing obvious. I only needed ffmpeg here for the thumbnailer anyway - and the other tests all pass.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2019-03-04 19:50:52 UTC
Can you reproduce after ports r494637?