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 7296 invoked from network); 23 Nov 2020 14:56:44 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2020 14:56:44 -0000 Received: (qmail 1595 invoked by uid 550); 23 Nov 2020 14:56:41 -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 1567 invoked from network); 23 Nov 2020 14:56:40 -0000 Date: Mon, 23 Nov 2020 09:56:29 -0500 From: Rich Felker To: Jonathan Wakely Cc: =?utf-8?B?0JDRgNGB0LXQvdC40Lk=?= , musl@lists.openwall.com, Florian Weimer Message-ID: <20201123145628.GV534@brightrain.aerifal.cx> References: <1605849917.737458858@f540.i.mail.ru> <87mtz99owk.fsf@mid.deneb.enyo.de> <20201122192824.GQ534@brightrain.aerifal.cx> <1606075554.931961164@f189.i.mail.ru> <20201123122428.GQ1312820@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201123122428.GQ1312820@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] 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