From owner-freebsd-threads@freebsd.org Tue Apr 11 23:58:52 2017 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91223D3A1A2; Tue, 11 Apr 2017 23:58:52 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7495F3A0; Tue, 11 Apr 2017 23:58:52 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 9531B52E9; Tue, 11 Apr 2017 23:58:51 +0000 (UTC) From: Jan Beich To: Christoph Moench-Tegeder Cc: freebsd-gecko@freebsd.org, freebsd-threads@freebsd.org Subject: Re: FreeBSD Port: www/firefox References: <1491928081558-6179754.post@n6.nabble.com> <37de-onxw-wny@FreeBSD.org> <20170411182519.GB1556@elch.exwg.net> Date: Wed, 12 Apr 2017 02:00:31 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 23:58:52 -0000 Christoph Moench-Tegeder writes: > ## Jan Beich (jbeich@FreeBSD.org): > >> Walter Schwarzenfeld (privately) writes: >> > With gtk3 on it starts after sysctl p1003_1b.sem_nsems_max=512. >> > Please => pkg-message. >> >> Don't use sem(4), it's deprecated since FreeBSD 9.0. p1003_1b.sem_nsems_max >> doesn't have an effect with the new implementation. >> >> https://svnweb.freebsd.org/changeset/base/201546 > > Um. Firefox' "configure" code explicitly checks the maximum number > of semaphores via sysconf(_SC_SEM_NSEMS_MAX) (that's in > python/futures/concurrent/futures/process.py l. 250). As far as I > can tell, in FreeBSD 10.3 that value is set by sysctl > p1003_1b.sem_nsems_max - so at least for the "old" FreeBSD, that > would be the way to go? (and it worked for me). FreeBSD 8.x has been EOL since 2015-08-01. However, sysconf() ends up using sem(4) even for new code. Maybe someone from threads@ knows more. $ getconf SEM_NSEMS_MAX undefined $ kldload sem $ getconf SEM_NSEMS_MAX 30 > Further, the sem(4) manpage has no deprecation note... From owner-freebsd-threads@freebsd.org Wed Apr 12 08:17:31 2017 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E4DD3AA8A; Wed, 12 Apr 2017 08:17:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E95DAE6; Wed, 12 Apr 2017 08:17:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v3C8HIW9046604 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 12 Apr 2017 11:17:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v3C8HIW9046604 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v3C8HIlP046602; Wed, 12 Apr 2017 11:17:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Apr 2017 11:17:18 +0300 From: Konstantin Belousov To: Jan Beich Cc: Christoph Moench-Tegeder , freebsd-gecko@freebsd.org, freebsd-threads@freebsd.org Subject: Re: FreeBSD Port: www/firefox Message-ID: <20170412081718.GU1788@kib.kiev.ua> References: <1491928081558-6179754.post@n6.nabble.com> <37de-onxw-wny@FreeBSD.org> <20170411182519.GB1556@elch.exwg.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 08:17:31 -0000 On Wed, Apr 12, 2017 at 02:00:31AM +0200, Jan Beich wrote: > Christoph Moench-Tegeder writes: > > > ## Jan Beich (jbeich@FreeBSD.org): > > > >> Walter Schwarzenfeld (privately) writes: > >> > With gtk3 on it starts after sysctl p1003_1b.sem_nsems_max=512. > >> > Please => pkg-message. > >> > >> Don't use sem(4), it's deprecated since FreeBSD 9.0. p1003_1b.sem_nsems_max > >> doesn't have an effect with the new implementation. > >> > >> https://svnweb.freebsd.org/changeset/base/201546 > > > > Um. Firefox' "configure" code explicitly checks the maximum number > > of semaphores via sysconf(_SC_SEM_NSEMS_MAX) (that's in > > python/futures/concurrent/futures/process.py l. 250). As far as I > > can tell, in FreeBSD 10.3 that value is set by sysctl > > p1003_1b.sem_nsems_max - so at least for the "old" FreeBSD, that > > would be the way to go? (and it worked for me). > > FreeBSD 8.x has been EOL since 2015-08-01. However, sysconf() ends up > using sem(4) even for new code. Maybe someone from threads@ knows more. > > $ getconf SEM_NSEMS_MAX > undefined > > $ kldload sem > $ getconf SEM_NSEMS_MAX > 30 The following should fix sysconf(3): diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index ffd9f6b4fa7..a69f3778b64 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* we just need the limits */ +#include #include #include #include "un-namespace.h" @@ -299,13 +300,9 @@ do_NAME_MAX: mib[1] = CTL_P1003_1B_RTSIG_MAX; goto yesno; case _SC_SEM_NSEMS_MAX: - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_SEM_NSEMS_MAX; - goto yesno; + return (-1); case _SC_SEM_VALUE_MAX: - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_SEM_VALUE_MAX; - goto yesno; + return (SEM_VALUE_MAX); case _SC_SIGQUEUE_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_SIGQUEUE_MAX; From owner-freebsd-threads@freebsd.org Wed Apr 12 19:08:20 2017 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E9AD3BFF7; Wed, 12 Apr 2017 19:08:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 987726C4; Wed, 12 Apr 2017 19:08:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id C1DBB37AB; Wed, 12 Apr 2017 19:08:19 +0000 (UTC) From: Jan Beich To: Konstantin Belousov Cc: Christoph Moench-Tegeder , freebsd-gecko@freebsd.org, freebsd-threads@freebsd.org Subject: Re: FreeBSD Port: www/firefox References: <1491928081558-6179754.post@n6.nabble.com> <37de-onxw-wny@FreeBSD.org> <20170411182519.GB1556@elch.exwg.net> <20170412081718.GU1788@kib.kiev.ua> Date: Wed, 12 Apr 2017 21:10:00 +0200 In-Reply-To: <20170412081718.GU1788@kib.kiev.ua> (Konstantin Belousov's message of "Wed, 12 Apr 2017 11:17:18 +0300") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 19:08:20 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Konstantin Belousov writes: > On Wed, Apr 12, 2017 at 02:00:31AM +0200, Jan Beich wrote: > >> Christoph Moench-Tegeder writes: >>=20 >> > ## Jan Beich (jbeich@FreeBSD.org): >> > >> >> Walter Schwarzenfeld (privately) writes: >> >> > With gtk3 on it starts after sysctl p1003_1b.sem_nsems_max=3D512. >> >> > Please =3D> pkg-message. >> >>=20 >> >> Don't use sem(4), it's deprecated since FreeBSD 9.0. p1003_1b.sem_nse= ms_max >> >> doesn't have an effect with the new implementation. >> >>=20 >> >> https://svnweb.freebsd.org/changeset/base/201546 >> > >> > Um. Firefox' "configure" code explicitly checks the maximum number >> > of semaphores via sysconf(_SC_SEM_NSEMS_MAX) (that's in >> > python/futures/concurrent/futures/process.py l. 250). As far as I >> > can tell, in FreeBSD 10.3 that value is set by sysctl >> > p1003_1b.sem_nsems_max - so at least for the "old" FreeBSD, that >> > would be the way to go? (and it worked for me). >>=20 >> FreeBSD 8.x has been EOL since 2015-08-01. However, sysconf() ends up >> using sem(4) even for new code. Maybe someone from threads@ knows more. >>=20 >> $ getconf SEM_NSEMS_MAX >> undefined >>=20 >> $ kldload sem >> $ getconf SEM_NSEMS_MAX >> 30 > > The following should fix sysconf(3): > > diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c > index ffd9f6b4fa7..a69f3778b64 100644 > --- a/lib/libc/gen/sysconf.c > +++ b/lib/libc/gen/sysconf.c > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include /* we just need the limits */ > +#include > #include > #include > #include "un-namespace.h" > @@ -299,13 +300,9 @@ do_NAME_MAX: > mib[1] =3D CTL_P1003_1B_RTSIG_MAX; > goto yesno; > case _SC_SEM_NSEMS_MAX: > - mib[0] =3D CTL_P1003_1B; > - mib[1] =3D CTL_P1003_1B_SEM_NSEMS_MAX; > - goto yesno; > + return (-1); > case _SC_SEM_VALUE_MAX: > - mib[0] =3D CTL_P1003_1B; > - mib[1] =3D CTL_P1003_1B_SEM_VALUE_MAX; > - goto yesno; > + return (SEM_VALUE_MAX); > case _SC_SIGQUEUE_MAX: > mib[0] =3D CTL_P1003_1B; > mib[1] =3D CTL_P1003_1B_SIGQUEUE_MAX; I confirm, the patch fixes Firefox 53+ build with sem(4) loaded. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQF8BAEBCgBmBQJY7nuIXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b6VQH/1N1+GzRuT236h304Gmjmttf K46wLTKqkNGiQhmHjUipa04Mqgn7tRC9JxisG70WcP2rbx7Q94J02BZqm9opx7zE gCoT7xKMVpjAxic3ZVOrWeTFQGZVMgwCMYoAPtUfv32RURbUFvLKqX16PihTdHf3 magHE6/m3A5hOFxTbK4MGLT8oXGGSacXqcUacjwtEnb5Nk63j4EnkcpW0KHfYLEi PKNXPHid/Fi6ISFPj9gRmzDgWwLV/+sm1n6UuRehxhKLxBT06fT6xFWzXEQrUhle qdGq6lzT+Qk26T+02UTvSVd7mMLSJoa7TpYusI7QfbNgtL/vtfSRNE9pUbmN+Lo= =PmDL -----END PGP SIGNATURE----- --=-=-=--