From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73348 invoked by alias); 28 Sep 2018 16:40:43 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 73335 invoked by uid 89); 28 Sep 2018 16:40:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=alexey, Alexey, H*Ad:D*att.net, Hx-spam-relays-external:ESMTPA X-HELO: sonic308-12.consmr.mail.gq1.yahoo.com Received: from sonic308-12.consmr.mail.gq1.yahoo.com (HELO sonic308-12.consmr.mail.gq1.yahoo.com) (98.137.68.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Sep 2018 16:40:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1538152840; bh=v4s96NHI+59a2VAGkSlZFCLnM7qnHHgYd1ECYZrd/zU=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=jAumjK7a6l+YWXdgJZeSRkOuZGS+mnDTL1ScIKFXZh/EKxXS25KSzWSlzI1MOQkPl70Fmz/Dt5FZVzo8JvkNCVyzL/knF0lYDeJg+jCWJzS6/himPRJtSBAyaPFZ0ayL4e7pSCPsY78Z3ix6+4XE4IIC8bGkPQ/eEyQDWf18tWc= Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Fri, 28 Sep 2018 16:40:40 +0000 Received: from 216.100.252.242 (EHLO [172.17.3.32]) ([216.100.252.242]) by smtp432.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f20dd5ef803d4f5e008edede1f048d3c; Fri, 28 Sep 2018 16:40:39 +0000 (UTC) Subject: Re: Possible file download bug? To: Paul Smith , "crossgcc@sourceware.org" References: From: Alexey Neyman Message-ID: <36effe4f-f8ca-46a3-0557-987f636ef299@att.net> Date: Fri, 28 Sep 2018 16:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00019.txt.bz2 On 09/28/2018 06:11 AM, Paul Smith wrote: > Crossgcc, > > > I wanted to alert you to a possible bug. I'm using someone else's product that uses an old copy of Crossgcc and I've found the following issue, and from looking at the latest Crossgcc code I suspect the same bug still exists. > > > The issue is in scripts/functions in the code that downloads a file from the web using wget or curl. My local ISP 'catches' page load errors and returns their own generated HTML error page and the bug I'm seeing results from a file download believing it succeeded when actually it downloaded just a dummy HTML page. > > > In my case the files were always supposed to be variants on Linux tar files so it easy to use the Linux 'file' command to see if the file was actually an HTML page. I don't know whether you can do the same or whether the files you are downloaded are more diverse and need more careful checking, perhaps outside of the file download function. > > > However I wanted to alert you to this odd behaviour as it soaked up a few hours this morning identifying the cause and a fix. It has been an issue with some download servers, too (I think, the one hosting libelf is an example; SourceForge during their outages is another one): instead of an error response, they return a valid 200 code with an HTML page. Current crosstool-NG (on master) offers an ability to verify the digest of the download (MD5/SHA-1/SHA-256/SHA-512); such broken download would fail this verification - so crosstool-NG won't save it to the local cache and will bail out with an error. But, it is only on master, no released versions do such verification. Regards, Alexey.