Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 23 Nov 2020 09:56:29 -0500
From: Rich Felker <dalias@...c.org>
To: Jonathan Wakely <jwakely@...hat.com>
Cc: Арсений <a@...r0n.science>,
	musl@...ts.openwall.com, Florian Weimer <fw@...eb.enyo.de>
Subject: Re: Mutexes are not unlocking

On Mon, Nov 23, 2020 at 12:24:28PM +0000, Jonathan Wakely wrote:
> On 22/11/20 23:05 +0300, Арсений wrote:
> >
> >Hello,
> > 
> >I fixed the problem by making a workaround. Specifying -D_GLIBCXX_GTHREAD_USE_WEAK=0 forces libstdc++ headers do not use weak symbols. Mutexes are correctly locked and unlocked now.
> 
> That might "work" but is unsupported, because that macro is for
> libstdc++'s internal use, not for users to define/undefine.
> 
> But then libstdc++ doesn't support being compiled/linked against a
> glibc libstdc++ and then running against musl at runtime (I didn't
> even know that was an option until today) so one more unsupported
> thing probably won't hurt :-)
> 
> Maybe we should just bless the use of that macro as supported, which
> would solve https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89714

As you noted in comment 2, that won't fix the uses internal to
libstdc++.{so,a}, only the inlined ones. I think this could give the
wrong behavior in the opposite direction -- calling unlock without
lock, thereby causing an error (for error-checking mutexes) or trap
(if UB catching traps are in place for other types).

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.