From nobody Tue Dec 07 17:49:53 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4C94D18B1066 for ; Tue, 7 Dec 2021 17:49:58 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J7nr60vhWz4T0B; Tue, 7 Dec 2021 17:49:58 +0000 (UTC) (envelope-from se@freebsd.org) Received: from [IPV6:2003:cd:5f1d:f700:f420:16b:af2:5eb4] (p200300cd5f1df700f420016b0af25eb4.dip0.t-ipconnect.de [IPv6:2003:cd:5f1d:f700:f420:16b:af2:5eb4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4F2DF2A141; Tue, 7 Dec 2021 17:49:57 +0000 (UTC) (envelope-from se@freebsd.org) Message-ID: <4808c5fb-4d54-ecec-9796-e68cbc07e06d@freebsd.org> Date: Tue, 7 Dec 2021 18:49:53 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: git: 5e04571cf3cf - main - sys/bitset.h: reduce visibility of BIT_* macros Content-Language: de-DE To: Mark Millard Cc: Konstantin Belousov , Mark Johnston , freebsd-current References: From: Stefan Esser In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------UmoqKbeewJtpGFTMvVwxXdNV" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638899398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4lV/8iqoeZwjFOhZn6TeG7xCv3G3JKCedeW1AHK+L10=; b=fxfMosTI+Q862oGE6619lAAz8nm5zXtr2zdbd0xeomQp/n/O4PFgGoAntVppCFcowpid4X m0pLS8az6gpKQnFJXYKQhl422WnNl8ZOezK+tkUj16T9RAaRLHArmFoy5fzN6Gg8/ouVBL 7/cKT2lIlJrhgs8K7/ZrtvyCEk/n1JANj436LlzIjtJs6i3v8GAx0I0IPR/65N/Ac2SaYf rtLYQp/JDEXhaxgZqWn0AGEkHarQaVhCqq21I/aMdavLSlDdqaiBiGCuq3Ylaf4p7XaTZy wUvPj2uWXEiCj1e2vXzwbFVZPCOlkE2Vg/dWPyy0RKkoXQGjilkC62YhktBdFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638899398; a=rsa-sha256; cv=none; b=TWdZZXCURD2CZg4GwwtJjDOxLip2gR2TVSjhGgawHEjyPC+VB3ZRkzxsOTc9K95jCPcftX aHe6d12Suy2UM/xkNRE1FlgszUM2E2XhvS+Yh0MJAxF835orRFfJ0zmVxlNgXLisUAMwjv YK2R7GiZy+RmY25uD7akHDwOOr9e0Kbn9QsSqCjlvlGt+ZLf9SSox/6J9mXJcNqfHpdXFF T8DN3UYyjsNNSulWJxATgXavkc9Cw1nD/1N91PSk3u5E/xXlWJDYW3i0GVYZEwGA0yNdaI acKXeWX+/2+8spNkxxo27QlFcEDgOxd9stNOXvvyXX5w76XXjO916Lh/FZkVjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------UmoqKbeewJtpGFTMvVwxXdNV Content-Type: multipart/mixed; boundary="------------KlzVuNV6daWUG0kuODVQRwaZ"; protected-headers="v1" From: Stefan Esser To: Mark Millard Cc: Konstantin Belousov , Mark Johnston , freebsd-current Message-ID: <4808c5fb-4d54-ecec-9796-e68cbc07e06d@freebsd.org> Subject: Re: git: 5e04571cf3cf - main - sys/bitset.h: reduce visibility of BIT_* macros References: In-Reply-To: --------------KlzVuNV6daWUG0kuODVQRwaZ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 07.12.21 um 01:50 schrieb Mark Millard: >=20 >=20 > On 2021-Dec-6, at 14:48, Mark Millard wrote: >=20 >> On 2021-Dec-6, at 14:19, Mark Millard wrote: >> >>> This broke building lang/gcc11 so may be a exp run is appropriate: >>> >>> In file included from /usr/include/sys/cpuset.h:39, >>> from /usr/include/sched.h:36, >>> from /usr/include/pthread.h:48, >>> from /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc= /jit/libgccjit.c:27: >>> /usr/include/sys/bitset.h:314:36: error: attempt to use poisoned "mal= loc" >>> 314 | #define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), = mt, (mf)) >>> | ^ [...] >> Just like the poudriere-devel based build on aarch64, >> amd64's poudriere-devel based build got: >> >> In file included from /usr/include/sys/cpuset.h:39, >> from /usr/include/sched.h:36, >> from /usr/include/pthread.h:48, >> from /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc= /jit/libgccjit.c:27: >> /usr/include/sys/bitset.h:314:36: error: attempt to use poisoned "mall= oc" >> 314 | #define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), = mt, (mf)) >> | ^ [...] > This happens from the sequence below, where system.h use in > the: >=20 > work/gcc-11.2.0/gcc/jit/{libgccjit,jit-recording,jit-playback}.c >=20 > builds is what poisons malloc in each case (and poisons more): >=20 > #include "config.h" > #include "system.h" > #include "coretypes.h" > #include "timevar.h" > #include "typed-splay-tree.h" > #include "cppbuiltin.h" > #include >=20 > After the poison-point, new macro definitions can not > reference malloc (and such) --nor can normal code. But > macros defined prior to the poison-point can contain > malloc (and such) and the use of such macros after > the poison point is okay. >=20 > So, if pthread.h is to define a macro referencing > malloc (say), then it needs to be included before > system.h is included in the way that things are set up > in this code. Hi Mark, sorry for (indirectly) causing the breakage ... The problem seems to be the inclusion of extra functionality in sched.h, that is required by a number of programs that use autoconfigure. They probe for one detail of sched.h and then try to use functionality that up to the commit you are referencing had to be hidden (made conditional on _WITH_CPUT_SET_T). The line that contains the malloc() is in a macro definition and AFAIU the situation there is no actual use of __BITSET_ALLOC in the gcc code. In fact, I could not find a single use of BITSEC_ALLOC in userland code. Therefore, the line that contains the malloc could be made conditional on _KERNEL being defined. > I've only tried to build lang/gcc11 (only as supplied > by the port). There could be more failure points for > the lang/gcc11 build that were skipped. At least the other gcc ports. I do not think that there are many other ports that do not accept the definition of a macro using malloc() in the way the poisoning in gcc does. > It seems likely that multiple lang/gcc* would have > such issues but I normally only build the lang/gcc11 > one at this point. I have not tested the other ports, but I do assume the same. I'll try to build the world with BITSET_ALLOC conditional on some macro that is not defined in the gcc build. Regards, STefan --------------KlzVuNV6daWUG0kuODVQRwaZ-- --------------UmoqKbeewJtpGFTMvVwxXdNV Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmGvnsEFAwAAAAAACgkQR+u171r99UQU zwgAyCsgFR4/L4qQzhwbNwUsXG0ALz1ht5NGMDpLP7w8VN6VKq9JXdiOtBFLF7ZZybZP2H0bUcMf KD8FkohxeWPASsYos4PLKjGFBSufmD71SsYfcUfXXdbnIyhza/WVbjKknnu8c3I5gpsQ1VUnkTxQ C8w7NlEsJLHL5EbWoVSYegduSJKgJjMIzQ+VMIwX510Wfht2IKsXADemhUN99nhy+MM1UvSYsgmB ZoZZ1se1SzjrP7mjP7CINAPe23ZUlYiV8i02ga/SEqeF6niYnlUSyS2QuDDIiiwCM+H/8jLkf9gR Z7LA0QePsrntnFeWSclxvhO9IOjWIliNWmoj2F72cQ== =tSZj -----END PGP SIGNATURE----- --------------UmoqKbeewJtpGFTMvVwxXdNV--