From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45392 invoked by alias); 27 Sep 2018 06:08:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 45351 invoked by uid 89); 27 Sep 2018 06:08:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:g11-v6m, life, Hx-spam-relays-external:209.85.215.196, H*RU:209.85.215.196 X-HELO: mail-pg1-f196.google.com Received: from mail-pg1-f196.google.com (HELO mail-pg1-f196.google.com) (209.85.215.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 06:08:00 +0000 Received: by mail-pg1-f196.google.com with SMTP id b129-v6so1073869pga.13; Wed, 26 Sep 2018 23:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VeziYz+JJEO1LqFY88esFHFdp7Tpwr0U4ZXHLNvexIU=; b=o9njzTXIzAIi5bBPmFLecxi7dRWj1cxmBVeMzT348pQGAEC9gufpe5HUgq7Hv5peG5 +7HmndHsnPsTRB4+TqMrgIOj9G2Nxvt3sxFFORV7ETsgWwty9Mf/AugP/g8Fmbz3dqSK InQwV8FB5EnHCBLOKQXWAPD8wJB7wA3Lc9LP6V29FbEurpm9p23bvf6QkkGMtKUqbA91 pH0tCC/TYQUFAQz6bMU2BvA4s5F7h0D7nx/5Pz3w/Mi0Bwwh6XsBfO8TU0TnpoQyToog qVD9R4i7ie618p03/s2iG6iNVeZcRhyFlVVxPC6JEikVcqEOw/T42AeBuLL2wWKYckFp cWew== Return-Path: Received: from localhost (g106.218-225-177.ppp.wakwak.ne.jp. [218.225.177.106]) by smtp.gmail.com with ESMTPSA id v83-v6sm2077046pfa.103.2018.09.26.23.07.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 23:07:58 -0700 (PDT) Date: Thu, 27 Sep 2018 06:08:00 -0000 From: Stafford Horne To: Nick Clifton Cc: Richard Henderson , binutils@sourceware.org, GDB patches , Openrisc Subject: Re: [PATCH 0/4] OpenRISC binutils updates and new relocs Message-ID: <20180927060756.GB3318@lianli.shorne-pla.net> References: <20180821143823.16985-1-shorne@gmail.com> <20180908213515.GN4594@lianli.shorne-pla.net> <20180918095234.GP4594@lianli.shorne-pla.net> <20b65fc3-5bbb-6e77-f598-4582204ee0e5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20b65fc3-5bbb-6e77-f598-4582204ee0e5@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00869.txt.bz2 Hi Nick, On Tue, Sep 18, 2018 at 12:55:48PM +0100, Nick Clifton wrote: > One other thing: There are several places where you add calls to > abort(). Now this is not wrong, and certainly not a reason to > reject the patch, but I consider it to be unhelpful. To my mind > a library, or tool, should generate an error message when something > goes wrong and not leave the user wondering why they have suddenly > got a segmentation fault. > > Plus if you have a call to abort() in the code you can bet that some > enterprising person with a binary fuzzer will find a way to trigger > it, and then file a CVE about it. (Fixing CVEs is the bane of my > life as they involve lots of extra administrivia). I have been away the last week and am just getting to fixing these abort()'s now. However, I have a question. The aborts I see are: bfd/elf32-or1k.c (or1k_final_link_relocate) - 2 places cpu/or1k-asm.c (parse_imm16) - 1 place In these cases we call abort if a switch statement falls through to the default case. If we get an abort its definitely a bug. To produce these errors I need to change the code, Using abort we see: /home/shorne/work/gnu-toolchain/local/lib/gcc/or1k-elf/9.0.0/../../../../or1k-elf/bin/ld: \ BFD (GNU Binutils) 2.31.51.20180927 internal error, \ aborting at ../../binutils-gdb/bfd/elf32-or1k.c:1152 in or1k_final_link_relocate /home/shorne/work/gnu-toolchain/local/lib/gcc/or1k-elf/9.0.0/../../../../or1k-elf/bin/ld: \ Please report this bug. collect2: error: ld returned 1 exit status There is no segmentation fault. I agree, it is more nice to create a message inform which error triggered the issue. Is something like this ok? default: _bfd_error_handler (_("%pB: Unknown complain on overflow value on howto specified %d"), input_bfd, (int) howto->complain_on_overflow); abort(); i.e. _bfd_error_handler() followed by abort(). I couldn't really see a way to _bfd_error_handler() to actually cause the program to exit. -Stafford