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=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31426 invoked from network); 28 Oct 2020 22:02:02 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 Oct 2020 22:02:02 -0000 Received: (qmail 1164 invoked by uid 550); 28 Oct 2020 22:01:58 -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 1131 invoked from network); 28 Oct 2020 22:01:58 -0000 Date: Wed, 28 Oct 2020 23:01:46 +0100 From: Szabolcs Nagy To: Rich Felker Cc: musl@lists.openwall.com Message-ID: <20201028220146.GY2947641@port70.net> Mail-Followup-To: Rich Felker , musl@lists.openwall.com References: <20201028201104.GH534@brightrain.aerifal.cx> <20201028201815.GI534@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028201815.GI534@brightrain.aerifal.cx> Subject: Re: [musl] bug: sem_close always unmaps semaphore regardless of ref count * Rich Felker [2020-10-28 16:18:16 -0400]: > On Wed, Oct 28, 2020 at 04:11:05PM -0400, Rich Felker wrote: > > I found this while reading the code during review of lock usage for > > MT-fork. Test case attached (can be adapted for libc-test regression > > tests, I think, or improved to be a conformance test). > > > > Rich > > > #include > > > > int main() > > { > > char buf[] = "mysemXXXXXX"; > > if (!mktemp(buf)) return 1; > > sem_t *sem = sem_open(buf, O_CREAT|O_EXCL, 0600); > > sem_open(buf, 0); > > sem_unlink(buf); > > sem_close(sem); > > sem_post(sem); > > } > > Fixed in f70375df85d26235a45e74559afd69be59e5ff99. i added this to libc-test thanks