From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 824 invoked from network); 27 Apr 2021 20:34:13 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2021 20:34:13 -0000 Received: (qmail 14011 invoked by uid 550); 27 Apr 2021 20:34:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13993 invoked from network); 27 Apr 2021 20:34:07 -0000 X-Virus-Scanned: Debian amavisd-new at disroot.org To: musl@lists.openwall.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1619555632; bh=4EI8+HRLBc4dskjUwwunxcynQnFsTwsjAri6qygVBIo=; h=To:References:From:Subject:Date:In-Reply-To; b=IFLaeVd9DULvgOHbp/sdiam/i6Brfl/Bg5tmVWd5xt7vvI+GHU8glEFfwvAOZ545B +ddhTAyxcxcQ6F90HfwQ0GPKJxDI7cLvtDFa+6PNCtA2mp1PmTbJAHsKqdGI/gxx3k BzAfGQrPjzs2dg70APpKmvtzmiqNAyE1FTJp5F1DlJhHL0gAu9YzSJ7WnVz+d3YgBA yw+WYJNE0KVveQ8wwQdDiexStR0CybeiNOKZ8lHOM4/KAs8X3hlRm866SZA0ZEG1wv gGimyP7BXKpXg4GN4h+stETCn+g5IuzWPC5XyD+JY0iRM9LI2a78frCSqlZxT5X+d8 2M5S6cQqJQ0Qg== References: <611bff39248143248ce9edd6762fb804@tachyum.com> <20210427195550.GK2799122@port70.net> From: =?UTF-8?Q?=c3=89rico_Nogueira?= Message-ID: Date: Tue, 27 Apr 2021 17:33:48 -0300 Mime-Version: 1.0 In-Reply-To: <20210427195550.GK2799122@port70.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [musl] Re: libc-test issue with sem_close Em 27/04/2021 16:55, Szabolcs Nagy escreveu: > * Matus Kysel [2021-04-26 09:49:35 +0000]: >> Hi Szabolcs, >> >> I am using your library as part of my validation suite and recently I have updated it to latest master, but the sem_close test is not buildable for me as it is missing fcntl.h header. I have attached possible fix, because I did not found how to contribute to you repo. > > ccing musl, libc-test is mostly discussed there. > > posix says > > "Inclusion of the header may make visible symbols defined in the and headers." > > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html > > which sounds optional, not guaranteed visibility of O_ open flags in > semaphore.h, but sem_open is expected to be usable with only semaphore.h > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_open.html > > i'm not sure what is the strict standard requirement here, without > clarification i consider it a libc header issue if an api is not usable > with just the header where it is declared. > The linux man page for sem_open(3) says including is necessary for the flags, and indeed the test fails to build on glibc. The oflag argument specifies flags that control the operation of the call. (Definitions of the flags values can be obtained by including .) sem_open(name, 0) works without , otherwise it's necessary. Taking advantage of the fact that the regressions/sem_close-unmap test has been brought up, it has some interesting results: On glibc 2.32: - works with dynamic linking - segfaults in sem_open() with static linking (might be something wrong with the build?) On musl 1.2.2: - segfaults most of the time (always?) On musl master (aad50fcd791e009961621ddfbe3d4c245fd689a3): - completes successfully most of the time, segfaults ever so often (which would lead me to assume the fix from f70375df85d26235a45e74559afd69be59e5ff99 wasn't enough) Note: for musl master I ran it as /path/muslrepo/lib/libc.so /path/libc-tests/.../sem_close-unmap.exe Cheers, Érico