NetBSD Problem Report #54619

From wiz@yt.nih.at  Tue Oct 15 14:25:43 2019
Return-Path: <wiz@yt.nih.at>
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 B52107A179
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 15 Oct 2019 14:25:43 +0000 (UTC)
Message-Id: <20191015130919.D5F9A2AC18C@yt.nih.at>
Date: Tue, 15 Oct 2019 15:09:19 +0200 (CEST)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Subject: openjdk11: semaphore limit reached
X-Send-Pr-Version: 3.95

>Number:         54619
>Category:       pkg
>Synopsis:       openjdk11: semaphore limit reached
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    tnn
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 15 14:30:00 +0000 2019
>Closed-Date:    Sun Dec 29 21:23:27 +0000 2019
>Last-Modified:  Sun Dec 29 21:23:27 +0000 2019
>Originator:     Thomas Klausner
>Release:        NetBSD 9.99.17
>Organization:
Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only that the cat died nobly.
- Arnold Edinborough
>Environment:


Architecture: x86_64
Machine: amd64
>Description:
When compiling lang/openjdk11 on a NetBSD-9.99.17/amd64 with lots of cores
and 24 parallel jobs, I see a build failure with:

#  Internal Error (semaphore_posix.cpp:45), pid=19650, tid=129521800276992
#  guarantee(ret == 0) failed: Failed to initialize semaphore; error='No space left on device' (errno=ENOSPC)

Reducing the parallel jobs to 4 makes it build.
(Other packages build fine with 24 jobs.)
>How-To-Repeat:
See above.
>Fix:
Not provided.

Either I'm running into a kernel limit (which one? how to increase it?)
or this might even be a kernel bug.

>Release-Note:

>Audit-Trail:
From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54619 CVS commit: pkgsrc/lang/openjdk11
Date: Wed, 6 Nov 2019 22:55:54 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Wed Nov  6 22:55:54 UTC 2019

 Modified Files:
 	pkgsrc/lang/openjdk11: Makefile

 Log Message:
 openjdk11: set MAKE_JOBS_SAFE=no as a workaround for PR 54619


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/lang/openjdk11/Makefile

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

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/54619: openjdk11: semaphore limit reached
Date: Thu, 7 Nov 2019 00:58:16 +0100

 On Tue, Oct 15, 2019 at 02:30:00PM +0000, Thomas Klausner wrote:
 > When compiling lang/openjdk11 on a NetBSD-9.99.17/amd64 with lots of cores
 > and 24 parallel jobs, I see a build failure with:
 > 
 > #  Internal Error (semaphore_posix.cpp:45), pid=19650, tid=129521800276992
 > #  guarantee(ret == 0) failed: Failed to initialize semaphore; error='No space left on device' (errno=ENOSPC)

 kern.posix.semmax ?

 Joerg

From: Tobias Nygren <tnn@NetBSD.org>
To: Joerg Sonnenberger <joerg@bec.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: pkg/54619: openjdk11: semaphore limit reached
Date: Thu, 7 Nov 2019 01:04:42 +0100

 On Thu, 7 Nov 2019 00:58:16 +0100
 Joerg Sonnenberger <joerg@bec.de> wrote:

 > kern.posix.semmax ?

 Does nothing to remedy this, and kern.posix.semcnt is always 0.
 Something is wrong.

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	Thomas Klausner <wiz@NetBSD.org>
Subject: Re: pkg/54619: openjdk11: semaphore limit reached
Date: Thu, 7 Nov 2019 21:32:52 +0100

 On Thu, Nov 07, 2019 at 12:05:01AM +0000, Tobias Nygren wrote:
 >  On Thu, 7 Nov 2019 00:58:16 +0100
 >  Joerg Sonnenberger <joerg@bec.de> wrote:
 >  
 >  > kern.posix.semmax ?
 >  
 >  Does nothing to remedy this, and kern.posix.semcnt is always 0.
 >  Something is wrong.

 There also seems to be a hard-coded limit SEM_NSEMS_MAX in
 kern/uipc_sem.c. Try to raise that one?

 Joerg

Responsible-Changed-From-To: pkg-manager->tnn
Responsible-Changed-By: tnn@NetBSD.org
Responsible-Changed-When: Wed, 20 Nov 2019 12:03:44 +0000
Responsible-Changed-Why:
take


State-Changed-From-To: open->analyzed
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Wed, 20 Nov 2019 14:01:40 +0000
State-Changed-Why:
NetBSD has a hardcoded per-user semaphore limit of 256.
Running "java -version" creates 12 + NCPU semaphores.
So if you use MAKE_JOBS=32 on a 32 core machine that
will use at minimum 32 * (12 + 32) = 1408 semaphores.

The hardcoded limit in the kernel should be removed.
Even if we disable processor count detection during the
build it won't work properly with more than MAKE_JOBS=16.


From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54619 CVS commit: src
Date: Sun, 15 Dec 2019 20:25:25 +0000

 Module Name:	src
 Committed By:	joerg
 Date:		Sun Dec 15 20:25:25 UTC 2019

 Modified Files:
 	src/lib/libc/gen: sysconf.c
 	src/sys/kern: uipc_sem.c

 Log Message:
 PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with
 _SC_SEM_NSEMS_MAX. Report no limit for getconf(3). The ressource is
 naturally limited by the backing file descriptor, so no separate limit
 is necessary. Keep the accounting for debugging as it is part of the
 sysctl ABI exposed by the kernel.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/lib/libc/gen/sysconf.c
 cvs rdiff -u -r1.55 -r1.56 src/sys/kern/uipc_sem.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54619 CVS commit: [netbsd-9] src
Date: Wed, 18 Dec 2019 20:20:17 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Dec 18 20:20:17 UTC 2019

 Modified Files:
 	src/lib/libc/gen [netbsd-9]: sysconf.c
 	src/sys/kern [netbsd-9]: uipc_sem.c

 Log Message:
 Pull up following revision(s) (requested by joerg in ticket #572):

 	sys/kern/uipc_sem.c: revision 1.56
 	lib/libc/gen/sysconf.c: revision 1.43

 PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with
 _SC_SEM_NSEMS_MAX. Report no limit for getconf(3). The ressource is
 naturally limited by the backing file descriptor, so no separate limit
 is necessary. Keep the accounting for debugging as it is part of the
 sysctl ABI exposed by the kernel.


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.41.16.1 src/lib/libc/gen/sysconf.c
 cvs rdiff -u -r1.55 -r1.55.4.1 src/sys/kern/uipc_sem.c

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

State-Changed-From-To: analyzed->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 29 Dec 2019 21:23:27 +0000
State-Changed-Why:
joerg's commit fixed the problem for me, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.45 2018/12/21 14:23:33 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.