coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#1037264: cksum crashes intermittently with "Illegal instruction"


From: Pádraig Brady
Subject: Re: Bug#1037264: cksum crashes intermittently with "Illegal instruction" on some Xen DomU
Date: Sat, 10 Jun 2023 11:09:36 +0100
User-agent: Mozilla Thunderbird

On 09/06/2023 18:40, Axel Beckert wrote:
Package: coreutils
Version: 9.1-1
Severity: important
X-Debbugs-Cc: abe@debian.org
Control: affects -1 aptitude-robot

On a Xen DomU running Debian 12, cksum intermittently crashes as
follows:

# while :; do dd if=/dev/urandom count=1 2> /dev/null | cksum ; done
1758277878 512
2101634611 512
Illegal instruction

So to summarise

* Debian 12 in Xen DomU exihibits this behaviour.

* Debian 11 in Xen DomU on same Dom0 does not exihibit this behaviour.

* The Xen Dom0 (Debian 11 though) itself does not exihibit this
   behaviour.

* A Debian 12 installation on bare metal with the same CPU ("AMD EPYC
   7313P 16-Core Processor") as the Dom0 does not exhibit this
   behaviour.

Hence some more details about the system:

* cksum --debug says: "cksum: using pclmul hardware support"

* amd64-microcode on the Dom0 is at 3.20191218.1

cksum since v9.0 checks at runtime whether pclmul is supported.
It seems that check is not working appropriately on a Xen DomU.
The routine in question is pclmul_supported() at:
https://github.com/coreutils/coreutils/blob/b841f111/src/cksum.c#L160-L191

That either suggests xen is incorrectly setting PCLMUL and AVX bits,
or perhaps these two bits are not sufficient.
Hmm I wonder do we also need to explicitly check for SSSE3 support?

I.e. I wonder does cksum built with the following help?

BTW it would be worth checking if ssse3 is mentioned in /proc/cpuinfo also.
If it was NOT, then there would be more of a chance of that change helping.

diff --git a/src/cksum.c b/src/cksum.c
index 85afab0ac..98733dadf 100644
--- a/src/cksum.c
+++ b/src/cksum.c
@@ -172,7 +172,7 @@ pclmul_supported (void)
       return false;
     }

-  if (! (ecx & bit_PCLMUL) || ! (ecx & bit_AVX))
+  if (! (ecx & bit_PCLMUL) || ! (ecx & bit_AVX) || ! (ecx & bit_SSSE3))
     {
       if (cksum_debug)
         error (0, 0, "%s", _("pclmul support not detected"));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]