[Bug 266423] x11/openrgb SIGILL

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 15 Sep 2022 10:13:36 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266423

            Bug ID: 266423
           Summary: x11/openrgb SIGILL
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: interloper255@gmail.com
                CC: vidar@karlsen.tech
                CC: vidar@karlsen.tech
             Flags: maintainer-feedback?(vidar@karlsen.tech)

x11/openrgb from packages and ports crashes with SIGILL when executed. From my
preliminary (albeit brief) debugging, it seems similar to issues I've had with
other Qt ports (using qmake or cmake); they seemed to detect the wrong type of
CPU, resulting in incorrect assembly generation; it's not clear to me if this
is the problem here.

System information:
===================
$ uname -a 
FreeBSD monolith 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd64


Terminal output:
================
$ openrgb
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
Illegal instruction (core dumped) 


CPU information:
================

FreeBSD 13.1-RELEASE-p2 GENERIC amd64
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git
llvmorg-13.0.0-0-gd7b669b3a303)
VT(efifb): resolution 1024x768
CPU: AMD Ryzen 9 5950X 16-Core Processor             (3400.10-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xa20f10  Family=0x19  Model=0x21  Stepping=0
 
Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
 
Features2=0x7ef8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD
Features2=0x75c237ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,TCE,Topology,PCXC,PNXC,DBE,PL2I,MWAITX,ADMSKX>
  Structured Extended
Features=0x219c97a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,PQE,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA>
  Structured Extended Features2=0x40068c<UMIP,PKU,VAES,VPCLMULQDQ,RDPID>
  Structured Extended Features3=0x10<FSRM>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  AMD Extended Feature Extensions ID
EBX=0x111ef657<CLZERO,IRPerf,XSaveErPtr,RDPRU,WBNOINVD,IBPB,IBRS,STIBP,STIBP_ALWAYSON,PREFER_IBRS,SSBD>
  SVM: (disabled in BIOS) NP,NRIP,VClean,AFlush,DAssist,NAsids=32768
  TSC: P-state invariant, performance statistics


GDB:
====
I rebuilt the port with debug symbols for a the backtrace:

Thread 3 received signal SIGILL, Illegal instruction.
Privileged opcode.
[Switching to LWP 106164 of process 78996]
0x000000000057f028 in AuraUSBController::~AuraUSBController() ()
(gdb) bt
#0  0x000000000057f028 in AuraUSBController::~AuraUSBController() ()
#1  0x000000000057ef68 in AuraUSBController::GetConfigTable() ()
#2  0x000000000057ec8d in AuraUSBController::AuraUSBController(hid_device_*,
char const*) ()
#3  0x00000000005816d7 in
AuraMainboardController::AuraMainboardController(hid_device_*, char const*) ()
#4  0x00000000005937f1 in DetectAsusAuraUSBMotherboards(hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) ()
#5  0x00000000005619d8 in decltype ((static_cast<void
(*&std::__1::__invoke<void (*&)(hid_device_info*, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&),
hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&>(void (*&)(hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&), hid_device_info*&&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&))(hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >
const&)>({parm#1}))(static_cast<hid_device_info*>({parm#2}),
static_cast<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&>({parm#2}))) ()
#6  0x0000000000561987 in void std::__1::__invoke_void_return_wrapper<void,
true>::__call<void (*&)(hid_device_info*, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&),
hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&>(void (*&)(hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&), hid_device_info*&&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) ()
#7  0x0000000000561937 in std::__1::__function::__alloc_func<void
(*)(hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&), std::__1::allocator<void
(*)(hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>, void (hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>::operator()(hid_device_info*&&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) ()
#8  0x00000000005607f6 in std::__1::__function::__func<void
(*)(hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&), std::__1::allocator<void
(*)(hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>, void (hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>::operator()(hid_device_info*&&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) ()
#9  0x00000000004b291f in std::__1::__function::__value_func<void
(hid_device_info*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>::operator()(hid_device_info*&&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) const ()
#10 0x00000000004a8120 in std::__1::function<void (hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)>::operator()(hid_device_info*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) const ()
#11 0x00000000004a5edf in ResourceManager::DetectDevicesThreadFunction() ()
#12 0x00000000004b23a9 in decltype
(((*(static_cast<ResourceManager*>({parm#2}))).*{parm#1})())
std::__1::__invoke<void (ResourceManager::*)(), ResourceManager*, , void>(void
(ResourceManager::*&&)(), ResourceManager*&&) ()
#13 0x00000000004b232e in void
std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct,
std::__1::default_delete<std::__1::__thread_struct> >, void
(ResourceManager::*)(), ResourceManager*,
2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct,
std::__1::default_delete<std::__1::__thread_struct> >, void
(ResourceManager::*)(), ResourceManager*>&, std::__1::__tuple_indices<2ul>) ()
#14 0x00000000004b2030 in void*
std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct,
std::__1::default_delete<std::__1::__thread_struct> >, void
(ResourceManager::*)(), ResourceManager*> >(void*) ()
#15 0x000000080193583a in ?? () from /lib/libthr.so.3
#16 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfdfd000


Disassembly shows a `ud2` instruction, so I guess the SIGILL is intentional:

<snip>

0x57efc6 <_ZN17AuraUSBControllerD2Ev+38>                call   0x8dcd30
<hid_close@plt>
0x57efcb <_ZN17AuraUSBControllerD2Ev+43>                jmp    0x57efd0
<_ZN17AuraUSBControllerD2Ev+48>
0x57efd0 <_ZN17AuraUSBControllerD2Ev+48>                mov    -0x20(%rbp),%rdi
0x57efd4 <_ZN17AuraUSBControllerD2Ev+52>                add    $0x68,%rdi
0x57efd8 <_ZN17AuraUSBControllerD2Ev+56>                call   0x8dc0a0
<_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9all|
0x57efdd <_ZN17AuraUSBControllerD2Ev+61>                mov    -0x20(%rbp),%rdi
0x57efe1 <_ZN17AuraUSBControllerD2Ev+65>                add    $0x50,%rdi
0x57efe5 <_ZN17AuraUSBControllerD2Ev+69>                call   0x57f360
<_ZNSt3__16vectorI14AuraDeviceInfoNS_9allocatorIS1_EE|
0x57efea <_ZN17AuraUSBControllerD2Ev+74>                add    $0x20,%rsp
0x57efee <_ZN17AuraUSBControllerD2Ev+78>                pop    %rbp
0x57efef <_ZN17AuraUSBControllerD2Ev+79>                ret
0x57eff0 <_ZN17AuraUSBControllerD2Ev+80>                mov    -0x20(%rbp),%rdi
0x57eff4 <_ZN17AuraUSBControllerD2Ev+84>                mov    %rax,%rcx
0x57eff7 <_ZN17AuraUSBControllerD2Ev+87>                mov    %edx,%eax
0x57eff9 <_ZN17AuraUSBControllerD2Ev+89>                mov    %rcx,-0x10(%rbp)
0x57effd <_ZN17AuraUSBControllerD2Ev+93>                mov    %eax,-0x14(%rbp)
0x57f000 <_ZN17AuraUSBControllerD2Ev+96>                add    $0x68,%rdi
0x57f004 <_ZN17AuraUSBControllerD2Ev+100>               call   0x8dc0a0
<_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9all|
0x57f009 <_ZN17AuraUSBControllerD2Ev+105>               mov    -0x20(%rbp),%rdi
0x57f00d <_ZN17AuraUSBControllerD2Ev+109>               add    $0x50,%rdi
0x57f011 <_ZN17AuraUSBControllerD2Ev+113>               call   0x57f360
<_ZNSt3__16vectorI14AuraDeviceInfoNS_9allocatorIS1_EE|
0x57f016 <_ZN17AuraUSBControllerD2Ev+118>               mov    -0x10(%rbp),%rdi
0x57f01a <_ZN17AuraUSBControllerD2Ev+122>               call   0x3d0510
<__clang_call_terminate>
0x57f01f                                                nop
0x57f020 <_ZN17AuraUSBControllerD0Ev>                   push   %rbp
0x57f021 <_ZN17AuraUSBControllerD0Ev+1>                 mov    %rsp,%rbp
0x57f024 <_ZN17AuraUSBControllerD0Ev+4>                 mov    %rdi,-0x8(%rbp)
> 0x57f028 <_ZN17AuraUSBControllerD0Ev+8>                 ud2


If I can provide any further information, please let me know.

C.

-- 
You are receiving this mail because:
You are the assignee for the bug.