[systemd-devel] Illegal CPUID instruction causes systemd core dump

tedheadster tedheadster at gmail.com
Thu Dec 28 19:07:30 UTC 2017


I am doing regression testing on old hardware. systemd-233 just
generated the following error on startup:

traps:systemd[1] trap invalid opcode ip:b7d97361 sp:bfa2f6bc error:0
in libsystemd-shared-233.so[b7d3e000+1cc000]
systemd[1]: Caught <ILL>, dumped core as pid 78.
systemd[1]: Freezing execution

I believe it is getting an illegal instruction trap on this first
generation 486 because it is calling "cpuid" in detect_vm_cpuid()
without first checking if the hardware supports it; it doesn't in this
case.

The gcc compiler provides a workaround in the cpuid.h header file. You
can call __get_cpuid_max() first and check the return value > 0.

https://stackoverflow.com/questions/14266772/how-do-i-call-cpuid-in-linux#14266932

The Linux kernel still supports the 486 so we have to code around this
case, even if it is ancient hardware.

- Matthew


More information about the systemd-devel mailing list