Bug 240039 - mixer(8): setting a mixer device with an empty string (`mixer pcm ""`) does not return
Summary: mixer(8): setting a mixer device with an empty string (`mixer pcm ""`) does n...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mateusz Piotrowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-22 15:53 UTC by Mateusz Piotrowski
Modified: 2020-03-13 11:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer freebsd_triage 2019-08-22 15:53:54 UTC
The mixer(8) command does not return if I use it to set a value of one of mixer devices to an empty string, for example `mixer pcm ""`. It does not make much sense to set the value to an empty string, but I should get at least an error message.

Tested on FreeBSD 10.4-RELEASE and FreeBSD 13.0-CURRENT.
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2019-08-24 21:13:24 UTC
Can you run gdb on the hanging process and type "bt" + enter?

pkg install gdb

gdb83 -p XXXPID
bt

--HPS
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2019-08-24 22:48:22 UTC
(In reply to Hans Petter Selasky from comment #1)
I've posted the patch here:
https://reviews.freebsd.org/D21409
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-08-25 17:56:14 UTC
A commit references this bug:

Author: 0mp
Date: Sun Aug 25 17:55:33 UTC 2019
New revision: 351481
URL: https://svnweb.freebsd.org/changeset/base/351481

Log:
  mixer(8): Report an error if the passed value is an empty string

  This patch fixes a bug that made the mixer command enter
  an infinite loop when instructed to set the value of a device
  to an empty string (e.g., `mixer vol ""`).

  Additionally, some tests for mixer(8) are being added.

  PR:		240039
  Reviewed by:	hselasky, mav
  Approved by:	src (hselasky, mav)
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D21409

Changes:
  head/etc/mtree/BSD.tests.dist
  head/usr.sbin/mixer/Makefile
  head/usr.sbin/mixer/mixer.c
  head/usr.sbin/mixer/tests/
  head/usr.sbin/mixer/tests/Makefile
  head/usr.sbin/mixer/tests/mixer_test.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-03-13 11:27:44 UTC
A commit references this bug:

Author: 0mp
Date: Fri Mar 13 11:27:30 UTC 2020
New revision: 358955
URL: https://svnweb.freebsd.org/changeset/base/358955

Log:
  MFC 351481, 357619:

  Approved by:	bcr (mentor), hselasky (src)
  Differential Revision:	https://reviews.freebsd.org/D24058

  mixer(8): Report an error if the passed value is an empty string

  This patch fixes a bug that made the mixer command enter
  an infinite loop when instructed to set the value of a device
  to an empty string (e.g., `mixer vol ""`).

  Additionally, some tests for mixer(8) are being added.

  PR:		240039
  Reviewed by:	hselasky, mav
  Approved by:	src (hselasky, mav)
  Differential Revision:	https://reviews.freebsd.org/D21409

  mixer: call the cleanup function in a test

  The set_empty_value test has a cleanup function, but is not called.
  Fix it

  Reviewed by:	0mp
  Approved by:	kp
  Differential Revision:	https://reviews.freebsd.org/D23498

Changes:
_U  stable/12/
  stable/12/etc/mtree/BSD.tests.dist
  stable/12/usr.sbin/mixer/Makefile
  stable/12/usr.sbin/mixer/mixer.c
  stable/12/usr.sbin/mixer/tests/
  stable/12/usr.sbin/mixer/tests/mixer_test.sh