NetBSD Problem Report #56113

From www@netbsd.org  Sat Apr 17 08:08:45 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 38D3E1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Apr 2021 08:08:45 +0000 (UTC)
Message-Id: <20210417080843.D6B5D1A924A@mollari.NetBSD.org>
Date: Sat, 17 Apr 2021 08:08:43 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: Short reads on AF_UNIX/SOCK_STREAM sockets return early in CURRENT
X-Send-Pr-Version: www-1.0

>Number:         56113
>Category:       kern
>Synopsis:       Short reads on AF_UNIX/SOCK_STREAM sockets return early in CURRENT
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 17 08:10:00 +0000 2021
>Last-Modified:  Wed Sep 08 19:20:01 +0000 2021
>Originator:     nia
>Release:        NetBSD 9.99.81
>Organization:
>Environment:
NetBSD 9.99.81
>Description:
In netbsd-9 and earlier releases, small reads on AF_UNIX SOCK_STREAM
sockets provided a fixed number of requested bytes. It seems at some
point NetBSD -current was changed so that less bytes than requested
could be returned, and poll() will return before the full written
chunk is available.

This means that the JACK Audio Connection Kit (audio/jack) in pkgsrc
no longer works on NetBSD 10, see

https://marc.info/?l=netbsd-current-users&m=161779584825623&w=2

for further analysis.
>How-To-Repeat:
Attempt to use audio/jack on a recent-ish -current system, observe that
no clients can hold a connection and the server gets very confused.
>Fix:

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/56113: Short reads on AF_UNIX/SOCK_STREAM sockets return
 early in CURRENT
Date: Sat, 10 Jul 2021 04:12:20 +0000

 On Sat, Apr 17, 2021 at 08:10:00AM +0000, nia@pkgsrc.org wrote:
  > In netbsd-9 and earlier releases, small reads on AF_UNIX SOCK_STREAM
  > sockets provided a fixed number of requested bytes. It seems at some
  > point NetBSD -current was changed so that less bytes than requested
  > could be returned, and poll() will return before the full written
  > chunk is available.
  > 
  > This means that the JACK Audio Connection Kit (audio/jack) in pkgsrc
  > no longer works on NetBSD 10, see
  > 
  > https://marc.info/?l=netbsd-current-users&m=161779584825623&w=2
  > 
  > for further analysis.

 Jack is broken -- I'm surprised it ever worked anywhere like that.

 That said, if someone can figure out what changed the behavior and if
 it's not expensive to rectify it (but I expect it will be) it might be
 worth changing.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56113 CVS commit: pkgsrc/audio/jack
Date: Wed, 8 Sep 2021 19:19:20 +0000

 Module Name:	pkgsrc
 Committed By:	nia
 Date:		Wed Sep  8 19:19:20 UTC 2021

 Modified Files:
 	pkgsrc/audio/jack: DESCR MESSAGE.NetBSD Makefile PLIST buildlink3.mk
 	    distinfo
 Added Files:
 	pkgsrc/audio/jack/patches: patch-common_JackAudioAdapterFactory.cpp
 	    patch-common_memops.c patch-common_wscript
 	    patch-example-clients_wscript patch-netbsd_JackAtomic__os.h
 	    patch-netbsd_JackNetBSDTime.c patch-netbsd_JackPlatformPlug__os.h
 	    patch-netbsd_sun_JackSunAdapter.cpp
 	    patch-netbsd_sun_JackSunAdapter.h
 	    patch-netbsd_sun_JackSunDriver.cpp patch-netbsd_sun_JackSunDriver.h
 	    patch-posix_JackNetUnixSocket.cpp patch-posix_JackNetUnixSocket.h
 	    patch-posix_JackPosixSemaphore.cpp patch-posix_JackSocket.cpp
 	    patch-tests_wscript patch-tools_wscript patch-wscript
 Removed Files:
 	pkgsrc/audio/jack/files: atomicity.h
 	pkgsrc/audio/jack/patches: patch-config_sysdeps_atomicity.h
 	    patch-config_sysdeps_cycles.h patch-configure
 	    patch-drivers_coreaudio_Makefile.in
 	    patch-drivers_netjack_netjack__packet.c
 	    patch-drivers_oss_oss__driver.c patch-drivers_oss_oss__driver.h
 	    patch-drivers_sun_sun__driver.c patch-include_engine.h
 	    patch-jack_control.h patch-jack_types.h patch-jackd_engine.c
 	    patch-libjack_unlock.c patch-tools_netsource.c
 	    patch-tools_session__notify.c patch-tools_transport.c

 Log Message:
 jack: Update to 1.9.19

 This switches us to jack2, the latest rewrite of the JACK audio
 server, with support for Solaris, Linux, macOS, and NetBSD (support
 for NetBSD added by me in a series of patches...)

 My primary motivation for this update is to avoid jack1's unpleasant
 abuse of unix domain sockets such that it no longer works in NetBSD
 9.99.x (see PR kern/56113)


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/audio/jack/DESCR
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/audio/jack/MESSAGE.NetBSD
 cvs rdiff -u -r1.41 -r1.42 pkgsrc/audio/jack/Makefile
 cvs rdiff -u -r1.10 -r1.11 pkgsrc/audio/jack/PLIST
 cvs rdiff -u -r1.13 -r1.14 pkgsrc/audio/jack/buildlink3.mk
 cvs rdiff -u -r1.22 -r1.23 pkgsrc/audio/jack/distinfo
 cvs rdiff -u -r1.1 -r0 pkgsrc/audio/jack/files/atomicity.h
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/audio/jack/patches/patch-common_JackAudioAdapterFactory.cpp \
     pkgsrc/audio/jack/patches/patch-common_memops.c \
     pkgsrc/audio/jack/patches/patch-common_wscript \
     pkgsrc/audio/jack/patches/patch-example-clients_wscript \
     pkgsrc/audio/jack/patches/patch-netbsd_JackAtomic__os.h \
     pkgsrc/audio/jack/patches/patch-netbsd_JackNetBSDTime.c \
     pkgsrc/audio/jack/patches/patch-netbsd_JackPlatformPlug__os.h \
     pkgsrc/audio/jack/patches/patch-netbsd_sun_JackSunAdapter.cpp \
     pkgsrc/audio/jack/patches/patch-netbsd_sun_JackSunAdapter.h \
     pkgsrc/audio/jack/patches/patch-netbsd_sun_JackSunDriver.cpp \
     pkgsrc/audio/jack/patches/patch-netbsd_sun_JackSunDriver.h \
     pkgsrc/audio/jack/patches/patch-posix_JackNetUnixSocket.cpp \
     pkgsrc/audio/jack/patches/patch-posix_JackNetUnixSocket.h \
     pkgsrc/audio/jack/patches/patch-posix_JackPosixSemaphore.cpp \
     pkgsrc/audio/jack/patches/patch-posix_JackSocket.cpp \
     pkgsrc/audio/jack/patches/patch-tests_wscript \
     pkgsrc/audio/jack/patches/patch-tools_wscript \
     pkgsrc/audio/jack/patches/patch-wscript
 cvs rdiff -u -r1.1 -r0 \
     pkgsrc/audio/jack/patches/patch-config_sysdeps_atomicity.h \
     pkgsrc/audio/jack/patches/patch-config_sysdeps_cycles.h \
     pkgsrc/audio/jack/patches/patch-configure \
     pkgsrc/audio/jack/patches/patch-drivers_coreaudio_Makefile.in \
     pkgsrc/audio/jack/patches/patch-drivers_oss_oss__driver.c \
     pkgsrc/audio/jack/patches/patch-drivers_oss_oss__driver.h \
     pkgsrc/audio/jack/patches/patch-drivers_sun_sun__driver.c \
     pkgsrc/audio/jack/patches/patch-include_engine.h \
     pkgsrc/audio/jack/patches/patch-jack_control.h \
     pkgsrc/audio/jack/patches/patch-jack_types.h \
     pkgsrc/audio/jack/patches/patch-jackd_engine.c \
     pkgsrc/audio/jack/patches/patch-libjack_unlock.c \
     pkgsrc/audio/jack/patches/patch-tools_session__notify.c \
     pkgsrc/audio/jack/patches/patch-tools_transport.c
 cvs rdiff -u -r1.2 -r0 \
     pkgsrc/audio/jack/patches/patch-drivers_netjack_netjack__packet.c \
     pkgsrc/audio/jack/patches/patch-tools_netsource.c

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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.