Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171110010901.GO1627@brightrain.aerifal.cx>
Date: Thu, 9 Nov 2017 20:09:01 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: misc minor undefined behaviors in musl

On Thu, Nov 09, 2017 at 04:53:31PM -0500, Rich Felker wrote:
> > b) __pthread_tsd_run_dtors does not have a prototype
> > 
> > • in cleanup_fromsig, __pthread_tsd_run_dtors is called with an argument:
> > https://git.musl-libc.org/cgit/musl/tree/src/time/timer_create.c?id=1b9406b03c0a94ebe2076a8fc1746a8c45e78a83#n27
> > It is defined without a prototype here:
> > https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_key_create.c?id=1b9406b03c0a94ebe2076a8fc1746a8c45e78a83#n38
> > It is also called without an argument here:
> > https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_create.c?id=1b9406b03c0a94ebe2076a8fc1746a8c45e78a83#n38
> > and weak_alias'd to dummy_0 here:
> > https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_create.c?id=1b9406b03c0a94ebe2076a8fc1746a8c45e78a83#n18
> > 
> > • it seems like the above is on purpose, especially the definition
> > of __pthread_tsd_run_dtors without a prototype, which is still valid
> > in C11and does not mean the same thing as expecting void. Still, for
> > the sake of simplicity, would it be possible to uniformize to
> > __pthread_tsd_run_dtors always taking an argument? Can the
> > invocation without an argument in pthread_create.c end up being
> > linked with an implementation of __pthread_tsd_run_dtors that takes
> > an argument and actually uses it?
> 
> This looks like just a failure to update the one in timer_create.c.
> Rather than spending time analzing the issue we should just fix it;
> the argument is not needed.

Indeed, commit a6054e3c94aa0491d7366e4b05ae0d73f661bfe2 introduced the
mismatch. Fixing it. Thanks!

Rich

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.