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.129.124]) by sourceware.org (Postfix) with ESMTPS id 899E73858402 for ; Thu, 4 Apr 2024 16:35:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 899E73858402 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 899E73858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712248556; cv=none; b=cmrtHyUwS8iTVf2nK5udtnybcxJn/dLrsF7eijzzrqrE/vTqCkwnDrXLcXzW4Vlt+jXZBr33XDZc32a4wbXSp7DezNC14CGGedvYuEiSDPoOuzYPH0Brr3kYOg4N5nP5PEKushZlhWiEqymf4DTH4WkcQPTkS5nzV+w/px7zbJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712248556; c=relaxed/simple; bh=/FL1g03s2DCoW2tYZSMoWVpt5V8VnWsCsi7TiDhowY4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=vfjFUgfmumCtuYTRchpPNvaXOHvrFCR+9lBtz8JYdVzL29CrCB4XAVNkdKktyeIEXXwrjbHaCe1TLoi+m/T0f35oAT0jwRlc1wik2HhEj08d/EuOoQNezLwxZU1CXXNTM3nFrDavyxh8ydHuASnKOcytSpNR1ZCLGTnZLsMoEd8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712248555; 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=iLD1idB7Onri6KXUPxt1VkmhN/o2uUoEvdgETzeTL38dZpoCi5OV4QE20g1cN4ouxZlhso QrOszX/HRAdOkBVFWybfY9OOAwPTe/20nwxJ0YFWuezcWCVKXWt4FsKEpSEInAa6KaxcBA jBhf9TASdUEt98ftdg31xBQjAH1UOag= 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-647-k6UrNs3CNhu0XgYk1RYVfw-1; Thu, 04 Apr 2024 12:35:50 -0400 X-MC-Unique: k6UrNs3CNhu0XgYk1RYVfw-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-615073c8dfbso23164517b3.1 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=hFWuOJu3l7yY1oRv9juDa2HUlOmJK0DNsbiJaGUYcwLaahK9LTU/VQjuMGdH/3uwB0 kNIkHyRlZyk0Fxw5Ulb5YuhkIvTecJuKqSu1J9CUxXzKVuw0svpZpMv5Dbj59Kr0X60w EKvynA2n/ymKkJcArn2pPkNJv4vdjgqPkwwEmFDX/7tsrAHWbQIBQ5Haue0sIXXN1XWC uFBlgQBTN1EGirF89vzMq6/k7UQ1hJ8aq9T5oR6afFqOWIWsk5qNM74FALAAEBj6QlTF Li/eiG3JVE+080Kk8W16Yl7YbvgGoPeq4BujNKxGNNEuYJ5IiPzgag6gvF3gkg1dkFLD ZprA== X-Gm-Message-State: AOJu0YzlQquTSvmkfKGyIsdQWXvVvOYs61iTeiSt8Vtn/rguAxOozzXP 0F9anRDy0sR8LP6AnrRH6AgOrgQk/Yf3JrHmS6FlM2OF5xJIsYbvnIS68bVh+Krkb9NtR2BQxb2 H8wSUMGVoJ7X7gmBJmBNLsNzwBEGETSgu5n+zPg1F8o5KLy8YulVZ9Uq6HvK2jPmOvZOy3qOf0X tLnysQ3REprbo9ZfM7xijkK+0ODwhcduYc6Ls= X-Received: by 2002:a05:6902:1543:b0:dcc:7af5:97b4 with SMTP id r3-20020a056902154300b00dcc7af597b4mr3204411ybu.12.1712248550070; 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=unavailable 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...