From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5A7543858C50 for ; Thu, 4 Apr 2024 16:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A7543858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A7543858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712248553; cv=none; b=sFRlVZFrYO2Cru9+baVvUNlbkAihzhxw7djK3NbUaxYwRIX1ZrJDkc9JK7PRYE+WGLpiADlR6IGQg9sN9a4OCqvnOMTOkJTubKoob9H9pDgHIKJ1WZi0Urk6ORZe3opqG7lOZv5sFptpNca960qRbDlL+0qgSiIjrhdVmeC5eIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712248553; c=relaxed/simple; bh=/FL1g03s2DCoW2tYZSMoWVpt5V8VnWsCsi7TiDhowY4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=UZMvFmt+pY6k0JJrTkxRdaofLvOjfGn0aJMpV7bGfOACECzRUmO7AqsYhWekX86wE4c6z7Kx/mcJMiJ32ov2N1xwlJ0YiGfjsEXE3YLGfNVDAogHoZvYHqASVJj9V9w7yZZ1DuBj0mizCSL7zTlG4PNy3cdPw2qC363bEYl/KOU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712248552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gaZ6dcF9AcBdDFd6bMYncdBumLBdOJpvZSQOIY4dKSc=; b=HXrvPqh7YgiUL8AM9v6U2ofKTzEf5vS0D9IUI+3FBCCPdEZ118FExs61ZHXaxKYyOzYjIT vSJJh+u3JpF11E+WMRDQnOepmOL5lZTWNYoT3ah9PL9LcTvB6yiGJzGgd9M9lOmy4eeydV PS68FB4gkHGcJfM8cv9vjCwr44Wh0lg= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-8-85Io0lMcPUyfz-emoOuPZg-1; Thu, 04 Apr 2024 12:35:50 -0400 X-MC-Unique: 85Io0lMcPUyfz-emoOuPZg-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-609fe93b5cfso17969767b3.0 for ; Thu, 04 Apr 2024 09:35:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712248550; x=1712853350; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gaZ6dcF9AcBdDFd6bMYncdBumLBdOJpvZSQOIY4dKSc=; b=GU8k37qfkU1ZpDYgRfc17Zr8fy5LVN4eRbkL9lc+FzVQvWohCyLar30tTkS76dL246 kVjCbD6ALRf0OBA3Xr2kQdfYiQSCQFtqCqB/qpy6wMPyI+75BvfKd90E7KvxRYc24ceX c7AaH6roH1aTS+RwIrnIBSQxb0Eka+xjSA/hVqZ1ibgVypDhV+vmJjRBGLOxXxVTCY/B wxPAvD2AoKBiFdZGSNCdDdwcPpjJUkjZtbxmlPN4BhTZSo9POU/t+vsqnsqAtpj/Vwk2 weFpT1LRHf8ec1mobGOEgv3URnF/YUJeiqBGdl54hGoHQgmvr1yePC1REIjs2EuhwCEO Ks7Q== X-Forwarded-Encrypted: i=1; AJvYcCVrkgp0RyBzNTy/N6BB6l9FZ+9c6XPSlOrGioH+1wayddH8WJElPrrQvCXjs+z1nFRo6qZuwKGSSooCi92araYaDgMcvdx8BQ== X-Gm-Message-State: AOJu0YwCzFvomlJb3GNdYo8JK42Vy5C8LdX+lWBBFvHwZH2X05NcASBA twFMj+oUO5Pn8UvuHuH8TTVr9FgH2Qsn7HIYNIDUQwDbRmbsT+rb4s6zI5qmfadT2yZ3z7Qf9rx QMFWbhR7TXkrTme9StfQe0tDNCxhRzkpmcwoiZq/vKRTRLRK1brGY7cnKPHD5XtgJEmlgFjVSyU VfQ04qdjMUaDHqOgqEI3Tv6lyn2Zhj3A== X-Received: by 2002:a05:6902:1543:b0:dcc:7af5:97b4 with SMTP id r3-20020a056902154300b00dcc7af597b4mr3204413ybu.12.1712248550079; Thu, 04 Apr 2024 09:35:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG55aK54eYr33Tp9OcNssD9C+x6e4IdxeFennSj5y5SO4VRb4M4uF1fumHoB5vSuPi1RtM/gqHv6xO48pEgGrw= X-Received: by 2002:a05:6902:1543:b0:dcc:7af5:97b4 with SMTP id r3-20020a056902154300b00dcc7af597b4mr3204398ybu.12.1712248549802; Thu, 04 Apr 2024 09:35:49 -0700 (PDT) MIME-Version: 1.0 References: <20240404153158.313297-1-jwakely@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Thu, 4 Apr 2024 17:35:34 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Fix infinite loop in std::istream::ignore(n, delim) [PR93672] To: Ulrich Drepper Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 4 Apr 2024 at 17:33, Jonathan Wakely wrote: > > On Thu, 4 Apr 2024 at 17:29, Ulrich Drepper wrote= : > > > > On Thu, Apr 4, 2024 at 5:29=E2=80=AFPM Jonathan Wakely wrote: > > > I would appreciate more eyes on this to confirm my conclusions about > > > negative int_type values, and the proposed fix, make sense. > > > > The way something like this is handled in glibc's ctype functions is > > that both branches are considered. For isXXX(c) whether c is -v or > > 256-v the same value is returned (except for EOF which is -1). This > > caused the least number of bad surprises. > > > > You could here also perform similar actions. > > Yes, my first attempt to fix PR93672 did exactly that, see > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93672#c1 > > But since it doesn't work for '\xff' (because that's EOF when char is > signed) it only handles 127 of the 128 possible bugs ;-) > I'm also not sure it's conforming, since the standard specifies how > the matching is done, and that won't match negative chars. I might suggest relaxing the standard to allow it though...