NetBSD Problem Report #52213

From paul@whooppee.com  Wed May  3 22:26:42 2017
Return-Path: <paul@whooppee.com>
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 16E137A26D
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  3 May 2017 22:26:42 +0000 (UTC)
Message-Id: <20170503222638.CD80E16E68@speedy.whooppee.com>
Date: Thu,  4 May 2017 06:26:38 +0800 (+08)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: Several ptrace_wait test cases fail under DEBUG+LOCKDEBUG
X-Send-Pr-Version: 3.95

>Number:         52213
>Category:       kern
>Synopsis:       Several ptrace_wait test cases fail under DEBUG+LOCKDEBUG
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kamil
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 03 22:30:00 +0000 2017
>Closed-Date:    Sun Oct 13 15:47:04 +0000 2019
>Last-Modified:  Sun Oct 13 15:47:04 +0000 2019
>Originator:     Paul Goyette
>Release:        NetBSD 7.99.66
>Organization:
+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
>Environment:


System: NetBSD speedy.whooppee.com 7.99.66 NetBSD 7.99.66 (SPEEDY 2017-03-24 21:50:36 UTC) #0: Fri Mar 24 22:50:09 UTC 2017 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
When running the /usr/tests/lib/libc/sys/t_ptrace* tests on a kernel with
DEBUG and LOCKDEBUG, several test cases unexpectedly fail:

# atf-run t_ptrace* | atf-report
...
Failed test cases:
    t_ptrace_wait:dbregs_dr2_trap_variable_readwrite_read_4bytes, t_ptrace_wait:resume1, t_ptrace_wait3:resume1, t_ptrace_wait4:resume1, t_ptrace_waitpid:resume1

Summary for 7 test programs:
    901 passed test cases.
    5 failed test cases.
    60 expected failed test cases.
    1 skipped test cases.
# 

The failing tests generate "Expected failure" when run on a kernel with
DIAGNOSTIC but without DEBUG+LOCKDEBUG

(It is unclear if this is a failure in the kernel implementation, or if it
is a failure in the atf test code.  For now, I'm assuming the worst, and
have categoried this as a kernel bug - please feel free to correct me!)

Failure details for one example:

tc-start: 1493850103.488364, resume1
tc-so:Before forking process PID=867
tc-so:Parent process PID=867, child's PID=3944
tc-so:Before calling wait() for the child
tc-so:Before calling PT_TRACE_ME from child 3944
tc-so:Before raising Stopped (signal) from child
tc-so:Before resuming the child process where it left off and without signal to be sent
tc-so:Before calling wait() for the child - expected stopped SIGTRAP
tc-so:Before allocating memory for stack in child
tc-so:Before making context for new lwp in child
tc-so:Before creating new in child
tc-so:Send Message to parent fds
tc-so:Before reading siginfo and lwpid_t
tc-so:Before suspending LWP 2
tc-so:Wait Message from parent fds
tc-so:Before resuming the child process where it left off and without signal to be sent
tc-so:Before calling wait() for the child - expected stopped SIGINT
tc-so:Before resuming LWP 2
tc-so:Before resuming the child process where it left off and without signal to be sent
tc-so:Before calling wait() for the child - expected exited
tc-so:Before waiting for lwp 2 to exit
tc-se:t_ptrace_wait: /build/lc2/src_ro/tests/lib/libc/sys/t_ptrace_wait.c:7288 atfu_resume1_body(): Assertion failed for: _lwp_wait(lid, NULL) == 0: Resource deadlock avoided
tc-end: 1493850103.679355, resume1, failed, Test case raised a failure but was not expecting one; reason was /build/lc2/src_ro/tests/lib/libc/sys/t_ptrace_wait.h:233: WEXITSTATUS(status) != expected: The process has exited with invalid value 1 != 5




>How-To-Repeat:
see above

>Fix:
yes, please


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->kamil
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Wed, 03 May 2017 22:34:14 +0000
Responsible-Changed-Why:
Most likely person to fix this


State-Changed-From-To: open->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Sun, 13 Oct 2019 17:47:04 +0200
State-Changed-Why:
Fixed in HEAD as of today no longe reproducible.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.