NetBSD Problem Report #56528

From  Mon Nov 29 11:37:58 2021
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 154261A9239
	for <>; Mon, 29 Nov 2021 11:37:58 +0000 (UTC)
Message-Id: <>
Date: Mon, 29 Nov 2021 13:37:48 +0200 (EET)
From: (Andreas Gustafsson)
Reply-To: (Andreas Gustafsson)
Subject: x86_fpregs_fpu_write, x86_xstate_fpu_write test cases fail
X-Send-Pr-Version: 3.95

>Number:         56528
>Category:       port-i386
>Synopsis:       x86_fpregs_fpu_write, x86_xstate_fpu_write test cases fail
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 29 11:40:00 +0000 2021
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current
System: NetBSD
Architecture: i386
Machine: i386

When I run the ATF tests on NetBSD/i386 under "qemu -accel nvmm" on my
own testbed, the x86_fpregs_fpu_write and x86_xstate_fpu_write test
cases of multiple lib/libc/sys/t_ptrace_wait* tests fail, and have
done so ever since the tests in case were created.  Logs from a recent
failure are here:

The error messages is:

  t_ptrace_wait: /tmp/build/2021. x86_register_test(): Assertion failed for: vals_fpu.ip.fa_64 == expected_fpu.ip.fa_64: Undefined error: 0

Strangely, they do not fail on the TNF testbed even though it's a fairly
similar setup.  Some of the differences are:

  My testbed:  NetBSD/amd64 9.2, qemu-6.1.0nb4, Intel Xeon E5-2678 v3
  TNF testbed: NetBSD/amd64 9.0_STABLE, qemu-6.0.0nb2, AMD EPYC 7402P

To see the unexpectedly-unequal values, I applied this patch:

Index: t_ptrace_x86_wait.h
RCS file: /cvsroot/src/tests/lib/libc/sys/t_ptrace_x86_wait.h,v
retrieving revision 1.31
diff -u -r1.31 t_ptrace_x86_wait.h
--- t_ptrace_x86_wait.h	27 Oct 2020 08:32:36 -0000	1.31
+++ t_ptrace_x86_wait.h	29 Nov 2021 11:25:49 -0000
@@ -3324,8 +3324,8 @@
 				    == expected_fpu.tw_abridged);
-				FORKEE_ASSERT(vals_fpu.ip.fa_64
-				    == expected_fpu.ip.fa_64);
+				FORKEE_ASSERT_EQ(vals_fpu.ip.fa_64,
+				    expected_fpu.ip.fa_64);
 				    == expected_fpu.dp.fa_64);

This gives a slightly more informative error message:

  t_ptrace_wait: /tmp/build/2021. x86_register_test(): Assertion failed for: vals_fpu.ip.fa_64(1985229328) == expected_fpu.ip.fa_64(11649936536080)

Converting the values to hex:

  (gdb) print /x 1985229328
  $1 = 0x76543210
  (gdb) print /x 11649936536080
  $2 = 0xa9876543210

it looks like the top half of the 64-bit value is being unexpectedly cleared.



NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.