From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 65C0F3858D1E for ; Wed, 1 Nov 2023 20:47:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65C0F3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 65C0F3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698871676; cv=none; b=RM4MevGfSmgwzhQ/C/xitTR50IWfsPWhgGbEN++RyBawBiFDPEUg4tUKseYgm1Q0AB3Pqw/4AeythulH0KFl+JHAIveoIx5KGZEcA+UIUQ80AYwOX5Kt+KZi0jOqBhV8QIYEHSTWI1QuHUz7gV381HyFh/HC6+WcOseTsHWuaAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698871676; c=relaxed/simple; bh=NCL2ToiCrlWbtWmk66IqVqqevmOfLHPN6IUovfgvwB4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rwkxPPDsxcpS1e66IhDJrPUb+lY/y3nf4hyIRWYD9O0p01IbzL1RGuyAOgyf9fot79H5Ta+hJH1/VXOS7lz+ix+a7/lMB9A2D9bka1bWzN+7SyeEx6YrTwQS9c+GUAR4igQz+mrz8AymGsuxbfoIpmthsC2wrMrqE567eaXW6No= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5007a.ext.cloudfilter.net ([10.0.29.141]) by cmsmtp with ESMTPS id yGRfqfYdhKOkLyI7tqtiwm; Wed, 01 Nov 2023 20:47:45 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id yI7sqvwrc6uHPyI7sqnE8p; Wed, 01 Nov 2023 20:47:44 +0000 X-Authority-Analysis: v=2.4 cv=TuH1ORbh c=1 sm=1 tr=0 ts=6542b970 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=5oKYMwQNUstbdjv1OM0A:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Fd8E6jsGo6S0sJ02p2Yra/O2IrInmq1G9t7oo61Y5gk=; b=K811DARJuvbJiX7+kA/n95d2cx FZQQxZSUyQN1f9I0TO0hDwF4ztfmoQuCVKVpnzbrfEOxXN81vZSEC62fnr5+wLGcP7rSUjbV+R0nU K8RHWhy1u7NZAmQUyflmoCaxE; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:33038 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1qyI7r-002zMo-2A; Wed, 01 Nov 2023 14:47:43 -0600 From: Tom Tromey To: Tom Tromey Cc: Nick Clifton , binutils@sourceware.org Subject: Re: [PATCH 3/3] Add minimal thread-safety to BFD References: <20231026191435.204144-1-tom@tromey.com> <20231026191435.204144-4-tom@tromey.com> <9471e18d-f7cf-4630-a8c4-7a76d822c83c@redhat.com> <87r0l9tewg.fsf@tromey.com> X-Attribution: Tom Date: Wed, 01 Nov 2023 14:48:03 -0600 In-Reply-To: <87r0l9tewg.fsf@tromey.com> (Tom Tromey's message of "Wed, 01 Nov 2023 14:08:47 -0600") Message-ID: <87msvxtd30.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.77.73 X-Source-L: No X-Exim-ID: 1qyI7r-002zMo-2A X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (prentzel) [97.122.77.73]:33038 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOSebbkzvoMDncjOZ2Xq9OouXqXo8wsZ1XOA6zaq2Cgla5uW1MGcfTUvrIZAfknmb1FR50sSNdigHQdBK9N4tKHG60cQDrLytSQw1Jtc71PVB4XhS8hR 0wvgL7C3WCpKEFL+kZLqyiHgExLjRov5o66h5mVZO0LYjsvKe5awu4eOJ6fR0W7XCxaUv3WC5U5quJOy/ddB6k368V/l35gExyI= X-Spam-Status: No, score=-3018.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Nick> typedef bool (* bfd_lock_unlock_fn_type) (bfd *, void *); Tom> I suppose the BFD callers can just return if these fail. Well, I started on this change, but I am not sure about it now. cache_btell doesn't seem to have any way to even report an error. So, I'm not sure what to do there. Ignoring the failure is no good. Or, consider things like cache_bseek. Handling a failure of bfd_lock is easy, but there's an unlock at the end: int result = _bfd_real_fseek (f, offset, whence); bfd_unlock (); return result; If that fails should this really return -1? Similarly for cache_bwrite, etc. On the other hand, I don't think these things really can fail. Like, pthread_mutex_lock/unlock failures modes all are basically programming errors. So this may argue for just "doing anything". Or we could declare these to be infallible. Let me know what you'd prefer. Tom