NetBSD Problem Report #56865

From www@netbsd.org  Tue Jun  7 01:23:56 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0E41F1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  7 Jun 2022 01:23:56 +0000 (UTC)
Message-Id: <20220607012354.DFC911A923C@mollari.NetBSD.org>
Date: Tue,  7 Jun 2022 01:23:54 +0000 (UTC)
From: tgl@sss.pgh.pa.us
Reply-To: tgl@sss.pgh.pa.us
To: gnats-bugs@NetBSD.org
Subject: hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint
X-Send-Pr-Version: www-1.0

>Number:         56865
>Category:       port-hppa
>Synopsis:       hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-hppa-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 07 01:25:00 +0000 2022
>Closed-Date:    Fri Jun 17 06:00:24 +0000 2022
>Last-Modified:  Fri Jun 17 06:00:24 +0000 2022
>Originator:     Tom Lane
>Release:        HEAD/202206030100Z
>Organization:
PostgreSQL Global Development Group
>Environment:
NetBSD sss2.sss.pgh.pa.us 9.99.97 NetBSD 9.99.97 (SD2) #0: Fri Jun  3 12:30:06 EDT 2022  tgl@nuc1.sss.pgh.pa.us:/home/tgl/netbsd-H-202206030100Z/obj.hppa/sys/arch/hppa/compile/SD2 hppa
>Description:
The lib/libc/sys/t_ptrace_wait:core_dump_procinfo test case consistently fails on HPPA.  This turns out to be because the test doesn't know that on HPPA a breakpoint trap reports the address of the break instruction, so PC has to be advanced to continue afterwards.
>How-To-Repeat:
$ cd /usr/tests
$ atf-run lib/libc/sys/t_ptrace_wait

Note core_dump_procinfo failure.

(This is not the only failure in that test program, but I'm filing it separately since it's a distinct problem.)

>Fix:
Index: tests/lib/libc/sys/t_ptrace_core_wait.h
===================================================================
RCS file: /cvsroot/src/tests/lib/libc/sys/t_ptrace_core_wait.h,v
retrieving revision 1.5
diff -u -r1.5 t_ptrace_core_wait.h
--- tests/lib/libc/sys/t_ptrace_core_wait.h     26 Mar 2022 16:22:50 -0000      1.5
+++ tests/lib/libc/sys/t_ptrace_core_wait.h     6 Jun 2022 18:09:37 -0000
@@ -209,7 +209,7 @@
            "without signal to be sent\n");

 #if defined(__aarch64__) || defined(__arm__) || defined(__powerpc__) || \
-    defined(__sh3__) || defined(sparc)
+    defined(__sh3__) || defined(sparc) || defined(__hppa__)
        /*
         * For these archs, program counter is not automatically incremented
         * by a trap instruction. We cannot increment PC in the trap handler,

>Release-Note:

>Audit-Trail:
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56865 CVS commit: src/tests/lib/libc/sys
Date: Tue, 7 Jun 2022 05:39:16 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Tue Jun  7 05:39:16 UTC 2022

 Modified Files:
 	src/tests/lib/libc/sys: t_ptrace_core_wait.h

 Log Message:
 PR/56865: hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint

 Add __hppa__ to the list of architectures that need to advance to the instruction
 after the breakpoint

 Thanks to Tom Lane for the fix.


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_core_wait.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Tom Lane <tgl@sss.pgh.pa.us>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-hppa/56865: hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint
Date: Thu, 09 Jun 2022 13:12:02 -0400

 Umm ... the committed patch fails to fix this, because "__hppa__"
 is misspelled:

 #if defined(__aarch64__) || defined(__arm__) || defined(__hppa___) || \
     defined(__powerpc__) || defined(__sh3__) || defined(sparc)
         /*

 One "_" too many.

 			regards, tom lane

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Thu, 16 Jun 2022 06:18:36 +0000
State-Changed-Why:
Fix applied. OK to close?


From: Tom Lane <tgl@sss.pgh.pa.us>
To: gnats-bugs@netbsd.org
Cc: port-hppa-maintainer@netbsd.org
Subject: Re: port-hppa/56865 (hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint)
Date: Thu, 16 Jun 2022 09:37:08 -0400

 skrll@NetBSD.org writes:
 > Fix applied. OK to close?

 This one is working for me.

 			regards, tom lane

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Fri, 17 Jun 2022 06:00:24 +0000
State-Changed-Why:
Confirmed fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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