NetBSD Problem Report #54245

From dholland@macaran.eecs.harvard.edu  Wed May 29 00:10:08 2019
Return-Path: <dholland@macaran.eecs.harvard.edu>
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 3DF3D7A1F8
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 29 May 2019 00:10:08 +0000 (UTC)
Message-Id: <20190529001006.6EC5E6E2C0@macaran.eecs.harvard.edu>
Date: Tue, 28 May 2019 20:10:06 -0400 (EDT)
From: dholland@eecs.harvard.edu
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: xset(1): bell duration 0 is infinite
X-Send-Pr-Version: 3.95

>Number:         54245
>Category:       xsrc
>Synopsis:       xset(1): bell duration 0 is infinite
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    isaki
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 29 00:15:00 +0000 2019
>Closed-Date:    Sat Jun 22 08:21:33 +0000 2019
>Last-Modified:  Sat Jun 22 08:21:33 +0000 2019
>Originator:     David Holland
>Release:        NetBSD 8.99.41 (20190528)
>Organization:
>Environment:
System: NetBSD macaran 8.99.41 NetBSD 8.99.41 (MACARAN) #54: Tue May 28 18:10:56 EDT 2019 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

I discovered today while tinkering with a different problem (see other
PR) that if you do "xset b <volume> <pitch> 0", and then beep, this
means a beep that lasts forever and cannot, apparently, be stopped in
any obvious way.

This is probably upstream's bug, but we can probably afford to carry a
one-line patch to reject duration 0.

>How-To-Repeat:

As above.

>Fix:

Something like this?

Index: external/mit/xset/dist/xset.c
===================================================================
RCS file: /cvsroot/xsrc/external/mit/xset/dist/xset.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 xset.c
--- external/mit/xset/dist/xset.c	11 Mar 2018 08:53:18 -0000	1.1.1.7
+++ external/mit/xset/dist/xset.c	29 May 2019 00:08:58 -0000
@@ -265,7 +265,7 @@
 		    i++;

 		    arg = nextarg(i, argv);
-		    if (is_number(arg, 32767)) { /* If duration is given:  */
+		    if (is_number(arg, 32767) && atoi(arg) > 0) { /* If duration is given:  */
 			set_bell_dur(dpy, atoi(arg));	/*  set the bell.  */
 			i++;
 		    }

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: xsrc-manager->isaki
Responsible-Changed-By: isaki@NetBSD.org
Responsible-Changed-When: Sat, 22 Jun 2019 05:24:25 +0000
Responsible-Changed-Why:
I take it.


From: "Tetsuya Isaki" <isaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54245 CVS commit: src/sys/dev/wscons
Date: Sat, 22 Jun 2019 08:03:01 +0000

 Module Name:	src
 Committed By:	isaki
 Date:		Sat Jun 22 08:03:01 UTC 2019

 Modified Files:
 	src/sys/dev/wscons: wsbell.c

 Log Message:
 Add missing SETBELL() for WSKBDIO_COMPLEXBELL.
 wskbd_bell_data structure has value fields and operation bitmask field.
 "xset b * * 0" doesn't touch period field (and doesn't initialized it)
 and doesn't set DOPERIOD flag (this means that period field should not
 be used).  SETBELL() handles this situation appropliately.
 This happened during copying wsbell.c from wskbd.c.
 Fix PR xsrc/54245.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsbell.c

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

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: gnats-bugs@netbsd.org
Cc: xsrc-manager@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: xsrc/54245: xset(1): bell duration 0 is infinite
Date: Sat, 22 Jun 2019 17:15:55 +0900

 At Wed, 29 May 2019 00:15:00 +0000 (UTC),
 dholland@eecs.harvard.edu wrote:
 > Something like this?
 > 
 > Index: external/mit/xset/dist/xset.c

 I noticed following combination, so I fixed the kernel, not X.
 - It doesn't occur in 7.2 userland + 7.2 kernel.
 - It doesn't occur in 7.2 userland + 8.0 kernel.
 - It occurs in 7.2 userland + -current kernel.

 Thank you for reporting.
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

State-Changed-From-To: open->closed
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Sat, 22 Jun 2019 08:21:33 +0000
State-Changed-Why:
Committed.


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