From nobody Mon Sep 01 18:32:46 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cFyCy04DMz670V8 for ; Mon, 01 Sep 2025 18:32:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cFyCx6VCzz3PZ7 for ; Mon, 01 Sep 2025 18:32:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756751565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2qfWEN10zRAyEhzWDMrwZ448fd1P6+NrdTNJve2WTdg=; b=NQUWz8fc0pkJGRN1RruckMemY/TTtfaP0/nKls2b9ck/3k+8Oq8ni1szpJ0Ig7rIDzKMiz 8c9+UfNZoGcjxgAefYzHY4fz5DiY6wT5BY8iFytze6MIVEyTd1J96CIw/5HoYu+wHREZSf hl3EDVvenOr83QFgvuCRBsD1fKtb05+G06SPYt8E2/Q7gDGP8IdNFP5YP3k5A6MlQfWghJ K/qB1ztsM65ypuKfmySUBuFE3K0PTQdAHtBGuNoY46ddX5RlDXSbeIezQc+PBnrZU1bbxU jPjiq0K6W879VAgO2O/HIN/Uz8eP3MIRRHM7H/7SyQNZ6KzrG2s5yuStY4XQsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756751565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2qfWEN10zRAyEhzWDMrwZ448fd1P6+NrdTNJve2WTdg=; b=wqiG2ZFRdU2YPBu5ENJQmj4miY/tM4RRuILef3xyVR/M824lUNuIEN0FgOe1AAvyJ6X4Jm tlYE1bynviEBWRV3tPZVrqiNMHaqB4wn7Zy+u1JWt0HEkKwnohDZDLjtz9+80bksaKNgxj eXLO4wJHKE26H82oc98vtQX+JZgTkygMv/BbIzN4khG0EFyxDHHsjLeUueJvsPuZT46kn4 INlqh4ZiCyYEW9ugPqPFf4xjYWEYZG1VHoTgxajTHcW631lFcKPUvxMWIzYP/k8ZvcYgxe RCgeGbOf99jOHh0jH68CUjAFeHQh6R9N6gQVUOYq4lL8fhREZ1AC0HK3nkvLSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756751565; a=rsa-sha256; cv=none; b=LhWIlLbr10N81Uz8+bpXmNHjQSqF0PU1HjjeE6U4x1I/UpYaVVziQkJtL5JwAPXdwxNFvp g8+HJ0JRftquH36ILhz+h15L/KOsw6nqtpDv/uQL3Y+2mLvX9Ne482ZgeN5tdwhSVq3n0i a3uQqyqwMHiPcXv+MNnE1voi9a4Fz/XbU+KWaEEEnK0NX3KHcMWZ10mcbJW0oFLkfGmTyr Wd4MTgFLZPT/fHz2oRy85+Q3XbyQsbiXMdgFtd5eQVpOTw8pDiRkeZI/vWXbp2djQBPrnn O2/tSgN1iT17hdzLcUOE/IvB4Eg0HUv8S5lEf/G00VXaqqznAoO5TeednlkKCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cFyCx65KYz19vD for ; Mon, 01 Sep 2025 18:32:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 581IWjeC060161 for ; Mon, 1 Sep 2025 18:32:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 581IWjE8060160 for bugs@FreeBSD.org; Mon, 1 Sep 2025 18:32:45 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 289232] i386 (x87) signal incorrectly reports FPE_FLTRES over FPE_FLTUND when both are present Date: Mon, 01 Sep 2025 18:32:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.5-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: riverstdr@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D289232 --- Comment #9 from Dave Rivers --- The flag bits from the status word are modified before the signal handler is called to only reflect the meaning of the si_code. So, if originally the x87 flag bits had #U and #P set, the x87 #U flag bit = is turned off before invoking the signal handler so that the bits in the status register match the value of the SI_CODE (which is - unfortunate - because = it means there is no programmatic way to work-around his problem.)=20 If you look at this comment in /usr/src/sys/amd64/amd64/fpu.c, it says: * The macro to choose one of these values does these steps: 1) Throw * away status word bits that cannot be masked. 2) Throw away the bits * currently masked in the control word, assuming the user isn't * interested in them anymore. 3) Reinsert status word bit 7 (stack * fault) if it is set, which cannot be masked but must be presered. * 4) Use the remaining bits to point into the trapcode table. Step #2 is the one I thought would be the idea of removing any "uninteresti= ng" bits in the status register... but - I have to admit to not seeing in the c= ode precisely where that is accomplished. Seems like that would require a FLD= CW instruction, but I didn't find it...=20 Still - that seems to be the behavior I'm seeing - the fpu status word only= has the (one) bit set that match the value from si_code; when the operation wou= ld have set both. So, perhaps it's modifying the saved context to only have t= he one bit set, then when the process restarts that value is loaded into the F= PU status word? (But FXRSTOR will also restore the x87 FPU mask.) --=20 You are receiving this mail because: You are the assignee for the bug.=