NetBSD Problem Report #51888

From www@NetBSD.org  Sun Jan 15 20:48:59 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 759EA7A2A1
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Jan 2017 20:48:59 +0000 (UTC)
Message-Id: <20170115204858.8E9927A2B5@mollari.NetBSD.org>
Date: Sun, 15 Jan 2017 20:48:58 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [PATCH] tests/lib/libpthread/t_mutex: various fixes
X-Send-Pr-Version: www-1.0

>Number:         51888
>Category:       bin
>Synopsis:       [PATCH] tests/lib/libpthread/t_mutex: various fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 15 20:50:00 +0000 2017
>Closed-Date:    Mon Jan 16 18:31:37 +0000 2017
>Last-Modified:  Mon Jan 16 18:31:37 +0000 2017
>Originator:     Ngie Cooper
>Release:        7.0.2
>Organization:
>Environment:
n/a
>Description:
- Dump the protocol used for the scheduler -- this was extremely helpful in determining why a min_prio of 0 on FreeBSD always caused the test case to fail.
- Add sys/time.h and inttypes.h to fix compilation on FreeBSD (comments are in the patch as to why the #includes are needed).
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/51888: [PATCH] tests/lib/libpthread/t_mutex: various fixes
Date: Sun, 15 Jan 2017 12:59:18 -0800

 --Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Patch attached.
 -Ngie

 --Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E
 Content-Disposition: attachment;
 	filename=t_mutex-various-fixes.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_mutex-various-fixes.patch"
 Content-Transfer-Encoding: 7bit

 Index: lib/libpthread/t_mutex.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libpthread/t_mutex.c,v
 retrieving revision 1.14
 diff -u -r1.14 t_mutex.c
 --- lib/libpthread/t_mutex.c	31 Oct 2016 23:51:20 -0000	1.14
 +++ lib/libpthread/t_mutex.c	15 Jan 2017 20:56:43 -0000
 @@ -31,6 +31,8 @@
   The NetBSD Foundation, inc. All rights reserved.");
  __RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $");

 +#include <sys/time.h> /* For timespecadd */
 +#include <inttypes.h> /* For UINT16_MAX */
  #include <pthread.h>
  #include <stdio.h>
  #include <string.h>
 @@ -570,9 +572,16 @@
  	int min_prio = sched_get_priority_min(SCHED_FIFO);
  	for (int i = min_prio; i <= max_prio; i++) {
  		int prioceiling;
 +		int protocol;
 +
 +		PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr,
 +		    &protocol));
 +
 +		printf("priority: %d\nprotocol: %d\n", i, protocol);
  		PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i));
  		PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr,
  		    &prioceiling));
 +		printf("prioceiling: %d\n", prioceiling);
  		ATF_REQUIRE_EQ(i, prioceiling);
  	}
  }

 --Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51888 CVS commit: src/tests/lib/libpthread
Date: Mon, 16 Jan 2017 11:23:41 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Mon Jan 16 16:23:41 UTC 2017

 Modified Files:
 	src/tests/lib/libpthread: t_mutex.c

 Log Message:
 PR/51888: Ngie Cooper: more error checking, missing includes


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libpthread/t_mutex.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: snj@NetBSD.org
State-Changed-When: Mon, 16 Jan 2017 18:31:37 +0000
State-Changed-Why:
christos committed it. thanks!


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