From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E6120385842B for ; Wed, 27 Apr 2022 12:34:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6120385842B Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-77-QN_fYj3DOgOTTUwRuIv3Wg-1; Wed, 27 Apr 2022 08:34:44 -0400 X-MC-Unique: QN_fYj3DOgOTTUwRuIv3Wg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D77311066686; Wed, 27 Apr 2022 12:34:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CC0F40CFD0A; Wed, 27 Apr 2022 12:34:42 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH v2 1/4] libio: Assume _IO_MTSAFE_IO References: <20220426191523.833171-1-adhemerval.zanella@linaro.org> <20220426191523.833171-2-adhemerval.zanella@linaro.org> Date: Wed, 27 Apr 2022 14:34:40 +0200 In-Reply-To: <20220426191523.833171-2-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Tue, 26 Apr 2022 16:15:20 -0300") Message-ID: <87wnfahfhb.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2022 12:34:49 -0000 * Adhemerval Zanella via Libc-alpha: > It is already set by default on all supported architectures and it is > an expectation that stdio works on multi-threaded environments. So =E2=80=A6 this cleanup has got stuck in the past because it's actually m= ore than just a cleanup. We actually build most of glibc without libio locking. Looks like misc/ nss/ posix/ have not been covered before. Maybe we should just file a bug for the missing locking and fix this with this commit? > index 5af476c48b..c186375c31 100644 > --- a/sysdeps/nptl/libc-lock.h > +++ b/sysdeps/nptl/libc-lock.h > @@ -25,7 +25,7 @@ > =20 > =20 > /* Mutex type. */ > -#if defined _LIBC || defined _IO_MTSAFE_IO > +#if defined _LIBC > # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC > typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t; > # else This doesn't look quite right. Would we want to compile this unconditionally now? There's also some weirdness I can't explain. I get strange before/after symbol differences: DIFF eu-readelf -s after strip: nptl/pthread_rwlock_unlock.os --- /tmp/Left-ltjeu50v.o 2022-04-27 14:29:39.070599437 +0200 +++ /tmp/Right-jee20kfm.o 2022-04-27 14:29:39.074599395 +0200 @@ -1,5 +1,5 @@ =20 -Symbol table [11] '.symtab' contains 14 entries: +Symbol table [11] '.symtab' contains 13 entries: 4 local symbols String table: [12] '.strtab' Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UNDEF=20 @@ -12,7 +12,6 @@ 7: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 ___pthread_= rwlock_unlo> 8: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF __GI___libc= _fatal 9: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 __GI___pthr= ead_rwlock_> - 10: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 __pthread_r= wlock_unlock - 11: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 __pthread_r= wlock_unloc> - 12: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 pthread_rwl= ock_unlock@> - 13: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 pthread_rwl= ock_unlock@> + 10: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 __pthread_r= wlock_unloc> + 11: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 pthread_rwl= ock_unlock@> + 12: 0000000000000000 463 FUNC GLOBAL DEFAULT 1 pthread_rwl= ock_unlock@> Can you reproduce this? Thanks, Florian