Apps crashing with SIGILL in float_to_half4_f16c
A Fedora user reported two crashes (2093673 and 2093961), one in gnome-control-center and one in gnome-software, which were both caused by an illegal instruction error:
Program terminated with signal SIGILL, Illegal instruction.
#0 _mm_loadu_ps (__P=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/12/include/f16cintrin.h:69
69 return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
[Current thread is 1 (Thread 0x7fb987ac2540 (LWP 3159))]
Thread 1 (Thread 0x7fb987ac2540 (LWP 3159)):
#0 _mm_loadu_ps (__P=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/12/include/f16cintrin.h:69
No locals.
#1 float_to_half4_f16c (f=0x7fb96c0304e0, h=0x7ffff7a27060) at ../gsk/gl/fp16i.c:37
s = {0.141176477, 0.141176477, 0.141176477, 1}
i = <optimized out>
#2 0x00007fb98e1a8706 in rgba_to_half (h=0x7ffff7a27060, rgba=<optimized out>) at ../gsk/gl/gskglrenderjob.c:995
No locals.
Program terminated with signal SIGILL, Illegal instruction.
#0 _mm_loadu_ps (__P=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/12/include/f16cintrin.h:69
69 return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
[Current thread is 1 (Thread 0x7ffaec27eec0 (LWP 1991))]
Thread 1 (Thread 0x7ffaec27eec0 (LWP 1991)):
#0 _mm_loadu_ps (__P=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/12/include/f16cintrin.h:69
No locals.
#1 float_to_half4_f16c (f=0x562c62092a30, h=0x7ffe1f3fc7a8) at ../gsk/gl/fp16i.c:37
s = {0, 0, 0, 0.129999995}
i = <optimized out>
#2 0x00007ffaf0c1c71f in rgba_to_half (h=0x7ffe1f3fc7a8, rgba=<optimized out>) at ../gsk/gl/gskglrenderjob.c:995
No locals.
The backtraces differ from there on, but I think the problem is the same in both cases. I think the issue may be that we're using float_to_half4_f16c
when the CPU isn't actually capable of it and should be using float_to_half4_c
instead?
I asked the user on IRC what CPU he has and he said "ninth generation Intel core I7". I'll see if I can get more precise details.