From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7078 invoked by alias); 23 Nov 2009 19:00:08 -0000 Received: (qmail 7058 invoked by uid 22791); 23 Nov 2009 19:00:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Nov 2009 19:00:01 +0000 Received: from zps36.corp.google.com (zps36.corp.google.com [172.25.146.36]) by smtp-out.google.com with ESMTP id nANIxwAp031578 for ; Mon, 23 Nov 2009 10:59:59 -0800 Received: from pzk6 (pzk6.prod.google.com [10.243.19.134]) by zps36.corp.google.com with ESMTP id nANIxtmj022568 for ; Mon, 23 Nov 2009 10:59:55 -0800 Received: by pzk6 with SMTP id 6so3951146pzk.29 for ; Mon, 23 Nov 2009 10:59:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.249.2 with SMTP id w2mr585349wfh.198.1259002795361; Mon, 23 Nov 2009 10:59:55 -0800 (PST) In-Reply-To: <230dad3a0c3b3643ffa3d7e36453e8bf@95.235.216.248> References: <230dad3a0c3b3643ffa3d7e36453e8bf@95.235.216.248> Date: Mon, 23 Nov 2009 19:00:00 -0000 Message-ID: <38a0d8450911231059t29d1aa81u72072b5f52ae93c@mail.gmail.com> Subject: Re: Possible endless loop in lto-wrapper From: Rafael Espindola To: Leandro Nini Cc: gcc@gcc.gnu.org Content-Type: multipart/mixed; boundary=00504502ce9563861604790e6e52 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00628.txt.bz2 --00504502ce9563861604790e6e52 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1080 2009/11/22 Leandro Nini : > Hi, > > in gcc-4.5 lto-wrapper may end up in an endless loop in case of error: > > if for example a 'maybe_unlink_file' call from 'lto_wrapper_exit' fails it > calls 'fatal_perror' which in turn calls 'lto_wrapper_exit' again causing > an infinity of > > lto-wrapper: deleting LTRANS file /tmp/ccWjXUv8.lto.o: No such file or > directory > > error messages on the console. > > I've solved this by substituting 'maybe_unlink_file' with > 'unlink_if_ordinary' > whithin the 'lto_wrapper_exit' function. > Not sure if this is the best fix but hope it helps. Thanks for finding the bug! I think that we need something similar to what was done in the linker: Avoid trying to start a new cleanup if we are already in one. Leandro, can you try the attached patch? Diego, OK if it works? 2009-11-23 Rafael Avila de Espindola * lto-wrapper.c (lto_wrapper_exit): Don't try to delete files if being called recursively. > > Best Regards, > Leandro > =C2=A0-- Cheers, --=20 Rafael =C3=81vila de Esp=C3=ADndola --00504502ce9563861604790e6e52 Content-Type: text/x-diff; charset=US-ASCII; name="clean.patch" Content-Disposition: attachment; filename="clean.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g2dlwjyt0 Content-length: 1168 SW5kZXg6IGdjYy9sdG8td3JhcHBlci5jCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KLS0tIGdjYy9sdG8td3JhcHBlci5jCShyZXZpc2lvbiAxNTQ0NTIpCisr KyBnY2MvbHRvLXdyYXBwZXIuYwkod29ya2luZyBjb3B5KQpAQCAtNjYsMTIg KzY2LDIwIEBACiBzdGF0aWMgdm9pZAogbHRvX3dyYXBwZXJfZXhpdCAoaW50 IHN0YXR1cykKIHsKLSAgaWYgKGx0cmFuc19vdXRwdXRfZmlsZSkKLSAgICBt YXliZV91bmxpbmtfZmlsZSAobHRyYW5zX291dHB1dF9maWxlKTsKLSAgaWYg KGZsdG9fb3V0KQotICAgIG1heWJlX3VubGlua19maWxlIChmbHRvX291dCk7 Ci0gIGlmIChhcmdzX25hbWUpCi0gICAgbWF5YmVfdW5saW5rX2ZpbGUgKGFy Z3NfbmFtZSk7CisgIHN0YXRpYyBib29sIGNsZWFudXBfZG9uZSA9IGZhbHNl OworICBpZiAoIWNsZWFudXBfZG9uZSkKKyAgICB7CisgICAgICAvKiBTZXR0 aW5nIGNsZWFudXBfZG9uZSBwcmV2ZW50cyBhbiBpbmZpbml0ZSBsb29wIGlm IG9uZSBvZiB0aGUKKyAgICAgICAgIGNhbGxzIHRvIG1heWJlX3VubGlua19m aWxlIGZhaWxzLiAqLworICAgICAgY2xlYW51cF9kb25lID0gdHJ1ZTsKKwor ICAgICAgaWYgKGx0cmFuc19vdXRwdXRfZmlsZSkKKyAgICAgICAgbWF5YmVf dW5saW5rX2ZpbGUgKGx0cmFuc19vdXRwdXRfZmlsZSk7CisgICAgICBpZiAo Zmx0b19vdXQpCisgICAgICAgIG1heWJlX3VubGlua19maWxlIChmbHRvX291 dCk7CisgICAgICBpZiAoYXJnc19uYW1lKQorICAgICAgICBtYXliZV91bmxp bmtfZmlsZSAoYXJnc19uYW1lKTsKKyAgICB9CiAgIGV4aXQgKHN0YXR1cyk7 CiB9CiAK --00504502ce9563861604790e6e52--