From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2989F385841E; Tue, 7 Nov 2023 12:56:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2989F385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699361761; bh=nCy19rl7NS6cQEXhiCbDi33NvTFn7fq1WUqJMSfmpoA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N3lWDYSQJReFIOJNt9IFFYT9aznEwGQg5yb1GL21AqT5B5Y+UxK5rs4YwMFnqgagT 2mOJAniPXyuBu518jYldTvp6+BDNyF9LdGI/kkftaLGaBKmfrq3tBCCRsRfJGsWD+k LVFkhQm8Fl0Z0sDmE2VPtIuadRUElm/soZN3QyGo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/112351] libstdc++ locale init doesn't handle __gthread_once failure Date: Tue, 07 Nov 2023 12:55:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112351 --- Comment #3 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:7562f089a190953b8ef615b90b7b0520e812a930 commit r14-5220-g7562f089a190953b8ef615b90b7b0520e812a930 Author: Richard Biener Date: Mon Nov 6 11:31:40 2023 +0100 libstdc++/112351 - deal with __gthread_once failure during locale init The following makes the C++98 locale init path follow the way the C++11 performs initialization. This way we deal with pthread_once failing, falling back to non-threadsafe initialization which, given we initialize from the library, should be serialized by the dynamic loader already. PR libstdc++/112351 libstdc++-v3/ * src/c++98/locale.cc (locale::facet::_S_initialize_once): Check whether _S_c_locale is already initialized. (locale::facet::_S_get_c_locale): Always perform non-threadsafe init when threadsafe init failed.=