From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1005 invoked by alias); 5 Nov 2010 21:05:28 -0000 Received: (qmail 955 invoked by uid 22791); 5 Nov 2010 21:05:27 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,TW_RK,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Nov 2010 21:05:22 +0000 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id oA5L5KiH031891 for ; Fri, 5 Nov 2010 14:05:21 -0700 Received: from pwj6 (pwj6.prod.google.com [10.241.219.70]) by kpbe19.cbf.corp.google.com with ESMTP id oA5L5JDP028494 for ; Fri, 5 Nov 2010 14:05:19 -0700 Received: by pwj6 with SMTP id 6so993860pwj.4 for ; Fri, 05 Nov 2010 14:05:19 -0700 (PDT) Received: by 10.142.192.14 with SMTP id p14mr2035153wff.303.1288991119329; Fri, 05 Nov 2010 14:05:19 -0700 (PDT) Received: from coign.google.com (dhcp-172-22-125-228.mtv.corp.google.com [172.22.125.228]) by mx.google.com with ESMTPS id p8sm2325743wff.16.2010.11.05.14.05.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 14:05:18 -0700 (PDT) From: Ian Lance Taylor To: Cary Coutant Cc: Binutils Subject: Re: [gold][patch] Fix file descriptor leak References: Date: Fri, 05 Nov 2010 21:05:00 -0000 In-Reply-To: (Cary Coutant's message of "Fri, 5 Nov 2010 13:48:38 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00139.txt.bz2 Cary Coutant writes: > PR gold/10708 > * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the > object when reading from the file. > * gold.cc (queue_middle_tasks): Hold a lock on the object when doing > second layout pass. > * icf.cc (preprocess_for_unique_sections): Hold a lock on the object > when reading section contents. > (get_section_contents): Likewise. > (icf::find_identical_sections): Likewise. > * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the > object when reading from the file. > * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on > the object when doing deferred section layout. This is OK. We should add that assert you mentioned as soon as we can. We should also add some notion to the workqueue as to whether we are running single-threaded. We can use that to assert if there are ever two jobs runnable when we think we are single-threaded. We should then change these dummy_task Task_lock_obj calls to a different locker which asserts that we are single threaded, does not require a task, and calls variants of obj->lock and obj->unlock which do not use a task. Thanks for tracking this down. Ian