From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52844 invoked by alias); 9 Oct 2018 17:40:27 -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 52833 invoked by uid 89); 9 Oct 2018 17:40:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: resqmta-po-10v.sys.comcast.net Received: from resqmta-po-10v.sys.comcast.net (HELO resqmta-po-10v.sys.comcast.net) (96.114.154.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Oct 2018 17:40:26 +0000 Received: from resomta-po-04v.sys.comcast.net ([96.114.154.228]) by resqmta-po-10v.sys.comcast.net with ESMTP id 9v5MgWaiFcsma9vzcguNQz; Tue, 09 Oct 2018 17:40:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1539106824; bh=msSbb/vlJvw4xA/oeuRThDbh3PC9n+ylxV+cfvcns8Q=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=DNJR+QsM7xD6WWL7DuKr3/yyhJ4IFVjPGCtGuHlqQLl0YWC3R9IZ8mC/HfgSbPV4g Rt3L+KpiSvgUG+YMvZ7NGocTZ1iswzl9kRWK9j4gApTHAuKsbQ6vdbOJS9KHMUX500 rM6ebVw2uHyD35qWM4kXTtkJlKWlR3Ehvy01gNLVFdQVnvlbJGZlnPqtcMV28ddq+v biqrf6qK9z8dqVvUiUrL/pJ6AWiVWtWVHnvSRo7q6i96L+y+9P8KKHng/Szjn5dOWN 5Eb23KcpZz8T6M1TTkakx74UyR6FCcig6bTRiSTLgKcRQkeS1RGylWXr8XC5yPaTjW orSSqC33mBfCA== Received: from [192.168.10.125] ([73.60.223.101]) by resomta-po-04v.sys.comcast.net with ESMTPSA id 9vzcgzNR615A69vzcgsAlV; Tue, 09 Oct 2018 17:40:24 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH][gdb] fix unsigned overflow in charset.c From: Paul Koning In-Reply-To: <1acace4a-a5c6-abaf-f070-9c2e6768b6f2@redhat.com> Date: Tue, 09 Oct 2018 17:40:00 -0000 Cc: gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <7B48D309-445E-4141-A87A-1F3D5FA70EFD@comcast.net> <1acace4a-a5c6-abaf-f070-9c2e6768b6f2@redhat.com> To: Pedro Alves X-SW-Source: 2018-10/txt/msg00225.txt.bz2 > On Oct 9, 2018, at 1:31 PM, Pedro Alves wrote: >=20 > On 10/09/2018 06:19 PM, Paul Koning wrote: >> This fixed an overflow in pointer arithmetic that crashes GDB on Mac OS. >=20 > _unsigned_ overflow? That isn't undefined. Do we really want to trap > those? I don't think GCC's version does that. >=20 > From:=20 > https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#silencing-un= signed-integer-overflow > seems like there's a way to disable it. >=20 > Thanks, > Pedro Alves You're right, it was an LLVM build. I know unsigned overflow is well defin= ed with integers; is that true for pointers? Given that GDB triggers this issue, should the GDB build do that LLVM worka= round if LLVM is used to build it?=20=20 But it seems simpler to use the proposed patch; clearly the intent is to ba= ck up a pointer by -(space_left) and doing that operation on a signed type = seems like a logical thing to do, it makes the intended meaning clear. paul