SIGILL, Illegal instruction (might be related to AVX detection)
Hi! I'm unable to reach the display of my VMs because orc crashes with SIGILL.
I'm running orc 0.4.38-1 on ArchLinux :
$ pacman -Qi orc
Running /usr/bin/pacman through local proxy http://127.0.0.1:8080
Name : orc
Version : 0.4.38-1
Description : Optimized Inner Loop Runtime Compiler
Architecture : x86_64
URL : https://gstreamer.freedesktop.org/modules/orc.html
Licenses : BSD-3-Clause
Groups : None
Provides : liborc-0.4.so=0-64 liborc-test-0.4.so=0-64
Depends On : glibc
Optional Deps : None
Required By : gst-plugins-bad-libs gst-plugins-base-libs gst-plugins-good
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 1358.65 KiB
Packager : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date : Thu 29 Feb 2024 09:11:14 PM CET
Install Date : Tue 30 Apr 2024 12:15:33 AM CEST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Here's the stacktrace:
Core was generated by `/usr/bin/python /usr/bin/virt-manager --debug'.
Program terminated with signal SIGILL, Illegal instruction.
#0 0x00006094206dc004 in ?? ()
[Current thread is 1 (Thread 0x609414e006c0 (LWP 4470))]
(gdb) bt
#0 0x00006094206dc004 in ?? ()
#1 0x0000609420a5c573 in orc_memset (d1=0x6093dc0a4510, p1=0, n=38400) at ../orc/orc/orcfunctions.c:315
#2 0x00006094218c5eb9 in gst_audio_src_ring_buffer_acquire (buf=0xa4b9b41d2d0 [GstAudioSrcRingBuffer|audiosrcringbuffer1], spec=<optimized out>)
at ../gstreamer/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiosrc.c:387
#3 0x00006094218c594b in gst_audio_ring_buffer_acquire (buf=0xa4b9b41d2d0 [GstAudioSrcRingBuffer|audiosrcringbuffer1], spec=0xa4b9b41d358)
at ../gstreamer/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioringbuffer.c:680
#4 0x000060942189eec0 in gst_audio_base_src_setcaps (bsrc=0xa4b9b41c890 [GstPulseSrc|audiosrc-actual-src-puls], caps=<optimized out>)
at ../gstreamer/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiobasesrc.c:555
#5 0x00006094222c2313 in gst_base_src_set_caps (src=src@entry=0xa4b9b41c890 [GstPulseSrc|audiosrc-actual-src-puls], caps=caps@entry=0x6093dc0060c0 [GstCaps])
at ../gstreamer/subprojects/gstreamer/libs/gst/base/gstbasesrc.c:1027
#6 0x00006094206ff635 in gst_pulsesrc_negotiate (basesrc=0xa4b9b41c890 [GstPulseSrc|audiosrc-actual-src-puls]) at ../gstreamer/subprojects/gst-plugins-good/ext/pulse/pulsesrc.c:1452
#7 0x00006094222bec67 in gst_base_src_negotiate_unlocked (basesrc=basesrc@entry=0xa4b9b41c890 [GstPulseSrc|audiosrc-actual-src-puls])
at ../gstreamer/subprojects/gstreamer/libs/gst/base/gstbasesrc.c:3492
#8 0x00006094222bf4e8 in gst_base_src_loop (pad=0xa4b9b41a9e0 [GstPad|src]) at ../gstreamer/subprojects/gstreamer/libs/gst/base/gstbasesrc.c:2917
#9 0x0000609420f71145 in gst_task_func (task=0xa4b9b4231f0 [GstTask|audiosrc-actual-src-puls:src]) at ../gstreamer/subprojects/gstreamer/gst/gsttask.c:399
#10 0x000060942fcf0223 in g_thread_pool_thread_proxy (data=<optimized out>) at ../glib/glib/gthreadpool.c:336
#11 0x000060942fcea266 in g_thread_proxy (data=0x609424000de0) at ../glib/glib/gthread.c:835
#12 0x00006094306a6ded in start_thread (arg=<optimized out>) at pthread_create.c:447
#13 0x000060943072a0dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
If I'm not mistaken this is the line the backtrace is referring to.
I might be completely wrong but I suspect the culprit might be related to the way AVX support check is performed (it has happened before with other software). My CPU does support AVX but my hardened kernel disables it as a security measure ("gather data sample" mitigations). Orc should check for both CPU support and OS support.
In case that matters:
$ uname -a
Linux laptop 6.9.9-hardened1-1-hardened #1 SMP PREEMPT_DYNAMIC Thu, 11 Jul 2024 20:14:26 +0000 x86_64 GNU/Linux