NetBSD Problem Report #53343

From gson@gson.org  Tue Jun  5 14:46:39 2018
Return-Path: <gson@gson.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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2D5FD7A1B1
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  5 Jun 2018 14:46:39 +0000 (UTC)
Message-Id: <20180605144634.2F4B3989375@guava.gson.org>
Date: Tue,  5 Jun 2018 17:46:34 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: t_ptrace_wait*:traceme_vfork_crash_bus test cases fail
X-Send-Pr-Version: 3.95

>Number:         53343
>Category:       lib
>Synopsis:       t_ptrace_wait*:traceme_vfork_crash_bus test cases fail
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kamil
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 05 14:50:00 +0000 2018
>Closed-Date:    Tue Jan 22 03:49:43 +0000 2019
>Last-Modified:  Tue Jan 22 03:50:00 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2018.05.30.17.48.13
>Organization:
>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

The following test cases are failing:

  lib/libc/sys/t_ptrace_waitpid/traceme_vfork_crash_bus
  lib/libc/sys/t_ptrace_wait6/traceme_vfork_crash_bus
  lib/libc/sys/t_ptrace_wait3/traceme_vfork_crash_bus
  lib/libc/sys/t_ptrace_wait4/traceme_vfork_crash_bus
  lib/libc/sys/t_ptrace_wait/traceme_vfork_crash_bus

since the following commits:

  2018.05.30.17.31.34 kamil src/tests/kernel/h_segv.c 1.6
  2018.05.30.17.31.34 kamil src/tests/lib/libc/sys/t_ptrace_wait.h 1.10
  2018.05.30.17.48.13 kamil src/tests/kernel/h_segv.c 1.7
  2018.05.30.17.48.13 kamil src/tests/lib/libc/sys/t_ptrace_wait.h 1.11

on multiple platforms (at least amd64, i386 and sparc), on both
qemu and real hardawre.  Logs at (for example)

  http://www.gson.org/netbsd/bugs/build/amd64-baremetal/commits-2018.05.html#2018.05.30.17.48.13

>How-To-Repeat:

Inspect test logs.

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: lib-bug-people->kamil
Responsible-Changed-By: gson@NetBSD.org
Responsible-Changed-When: Tue, 05 Jun 2018 14:52:13 +0000
Responsible-Changed-Why:
Over to committer.


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/53343: t_ptrace_wait*:traceme_vfork_crash_bus test cases fail
Date: Wed, 6 Jun 2018 08:49:34 +0200

 On Tue, Jun 05, 2018 at 02:50:00PM +0000, Andreas Gustafsson wrote:
 > since the following commits:
 > 
 >   2018.05.30.17.31.34 kamil src/tests/kernel/h_segv.c 1.6
 >   2018.05.30.17.31.34 kamil src/tests/lib/libc/sys/t_ptrace_wait.h 1.10
 >   2018.05.30.17.48.13 kamil src/tests/kernel/h_segv.c 1.7
 >   2018.05.30.17.48.13 kamil src/tests/lib/libc/sys/t_ptrace_wait.h 1.11

 Looking at the diff I scratched my head and said "must be a kernel bug".

 There may, actually, be one hiding here. The child dumps core, but the
 core only is header and otherwise empty (so like 64byte). However, the
 parent does not get the proper status.

 But if you look at the name of the test (and the flow that happens in the
 source) it is quite clear that the test previously only worked due to
 plain luck. The vfork child process, while the parent is still blocked,
 does mmap() of a file to provoke the bus error. The mmap() call of course
 is strictly forbidden in this state (due to vfork restrictions).

 Kamil: I think we have to move the mmap() into the parent, and then trigger
 it in the child. Painfully complicating the test structure for this case,
 but should solve the issue.

 Martin

From: "Andreas Gustafsson" <gson@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53343 CVS commit: src/tests/lib/libc/sys
Date: Sun, 13 Jan 2019 11:03:21 +0000

 Module Name:	src
 Committed By:	gson
 Date:		Sun Jan 13 11:03:20 UTC 2019

 Modified Files:
 	src/tests/lib/libc/sys: t_ptrace_wait.c

 Log Message:
 Don't mark the traceme_vfork_crash_bus test case as an expected failure
 when it is executing as part of the lib/libc/sys/t_ptrace_waitid test,
 because that particular combination is not failing, at least not on amd64.
 It is failing as part of other tests, so PR lib/53343 still applies.


 To generate a diff of this commit:
 cvs rdiff -u -r1.67 -r1.68 src/tests/lib/libc/sys/t_ptrace_wait.c

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

From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53343 CVS commit: src/sys/kern
Date: Tue, 22 Jan 2019 03:44:45 +0000

 Module Name:	src
 Committed By:	kamil
 Date:		Tue Jan 22 03:44:45 UTC 2019

 Modified Files:
 	src/sys/kern: core_elf32.c

 Log Message:
 Fix code generation for programs with a faulty process map

 In case of any errors of scanning the segments reset
 their content to a default value with zeros. This is
 achieved with shortening the p_filesz parameter.

 This allows to emit core(5) files for a process
 regardless of its state of mappings, such as mapping
 pages after EOF in a file.

 Fixes PR lib/53343


 To generate a diff of this commit:
 cvs rdiff -u -r1.57 -r1.58 src/sys/kern/core_elf32.c

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

State-Changed-From-To: open->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Tue, 22 Jan 2019 04:49:43 +0100
State-Changed-Why:
Fixed in HEAD.


From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53343 CVS commit: src/tests/lib/libc/sys
Date: Tue, 22 Jan 2019 03:47:45 +0000

 Module Name:	src
 Committed By:	kamil
 Date:		Tue Jan 22 03:47:45 UTC 2019

 Modified Files:
 	src/tests/lib/libc/sys: t_ptrace_wait.c

 Log Message:
 Mark traceme_vfork_crash_bus as no longer failing

 Fixed in src/sys/kern/core_elf32.c r. 1.58

 Closes PR lib/53343


 To generate a diff of this commit:
 cvs rdiff -u -r1.68 -r1.69 src/tests/lib/libc/sys/t_ptrace_wait.c

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

>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.