NetBSD Problem Report #52118

From www@NetBSD.org  Tue Mar 28 03:21:17 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id AB1987A0F3
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 28 Mar 2017 03:21:17 +0000 (UTC)
Message-Id: <20170328032116.7E0C07A21A@mollari.NetBSD.org>
Date: Tue, 28 Mar 2017 03:21:16 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: x86: tests with debug registers sometimes fail
X-Send-Pr-Version: www-1.0

>Number:         52118
>Category:       kern
>Synopsis:       x86: tests with debug registers sometimes fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kamil
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 28 03:25:00 +0000 2017
>Last-Modified:  Mon Nov 06 04:29:38 +0000 2017
>Originator:     Kamil Rytarowski
>Release:        NetBSD 7.99.66 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 7.99.66 NetBSD 7.99.66 (GENERIC) #3: Tue Mar 28 02:01:26 CEST 2017  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
There is race with x86 debug register ATF t_ptrace_wait tests.

These tests almost always work on amd64, i386 and usually on xen. xen seems to be the most racy. amd64 and i386 appear to be very reliable, however at least it's possible to trigger it sometimes on i386.

Example failure:

Test case: kernel/arch/x86/t_ptrace_wait4/dbregs_dr2_trap_code

Duration: 0.555134 seconds
Termination reason

FAILED: /tmp/bracket/build/2017.03.26.18.38.33-i386/src/tests/kernel/arch/x86/../../t_ptrace_wait.h:305: WSTOPSIG(status) != expected: Unexpected stop signal received [Stopped (signal)] != [Trace/BPT trap]
Standard output stream

Before forking process PID=13550
Parent process PID=13550, child's PID=802
Before calling PT_TRACE_ME from child 802
Before calling wait4() for the child
Before raising Stopped (signal) from child
Call GETDBREGS for the child process (r1)
State of the debug registers (r1):
r1[0]=0
r1[1]=0
r1[2]=0
r1[3]=0
r1[4]=0
r1[5]=0
r1[6]=ffff0ff0
r1[7]=400
Set DR2 (r1.dr[2]) to new value 46ade6
Set DR7 (r1.dr[7]) to new value 20
New state of the debug registers (r1):
r1[0]=0
r1[1]=0
r1[2]=46ade6
r1[3]=0
r1[4]=0
r1[5]=0
r1[6]=ffff0ff0
r1[7]=20
Call SETDBREGS for the child process (r1)
Call CONTINUE for the child process
Before calling wait4() for the child
check_happy(1)=1
Before raising Stopped (signal) from child
>How-To-Repeat:
Run  kernel/arch/x86/t_ptrace_wait* tests.
>Fix:
N/A

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->kamil
Responsible-Changed-By: kamil@NetBSD.org
Responsible-Changed-When: Mon, 06 Nov 2017 05:29:38 +0100
Responsible-Changed-Why:
Take.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.