Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 28 Oct 2020 23:01:46 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: bug: sem_close always unmaps semaphore regardless of ref
 count

* Rich Felker <dalias@...c.org> [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 <semaphore.h>
> > 
> > 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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.