From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by sourceware.org (Postfix) with ESMTPS id 7BE9038515FF for ; Fri, 26 Mar 2021 12:00:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7BE9038515FF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=alyssa.is Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hi@alyssa.is Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 91BB11752; Fri, 26 Mar 2021 08:00:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 26 Mar 2021 08:00:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=4rLUA4NIESm42o64cSTvXp0v4Y 9UcbdLt6Apjb6g8ok=; b=ZCgjwYXEctc4b6lFpM4D4dO0RUfh0uSqLswN+B4WW5 7Gb+kiR9JSkSfq7m3dJgjBswuF85VBIPBbZZzhYviiJkOvD/yJfxr4yPTOKQe4S9 sQ/ES4t+S4plzK8uXusuCQtKHT4AURWSQseiudoK4ju9gXS1s732escmNxYNBSqr Q2AA6NxBZ7Hpost2XkzDKRNm5TW1/Ku1StiR0lrv2NRDKTvPT49Vw+2BxpNaNKYu BvVJkWt4ZeJXNGtlJwvzutmGIBb2atT+y87Ki+V4ZGL02h6YkDZRrTMfty7HJgiU Ix8c2TnN3dgy/c0RubR31MOtZAWIsukFKbkT7qlgFfxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=4rLUA4 NIESm42o64cSTvXp0v4Y9UcbdLt6Apjb6g8ok=; b=mafQpJiXkue3BT/t0cGvvX oZe/lGD7keVpHsSc9kvvyhqI8wSUmO0H/PC/EfL1XT5r5g4XMSb22bDLt75jrjjc Pm1ISS9fG2hIzOVpxvgPhjKTOTpjRBa7kcFFYBRO0SsmzgfMvsC6CEC5Dy6ZFP9X nKuGfNhhIRiaiAnGCPTfkgKHuEcGNOayAzztQ/0xb9lOVOyEI2mWaAdvVU8m5GoZ Fna5qRkEyfhNvr9ybZPPEE+366MTApP0O1E33yVh9swQL8WB/rmtY7P63HaXuZ84 h4YngyOO7OEF1sWw/HJaeKhqQ7ywkz8ej/0xKeLtF1asuC8t8vXyo3Su78i4LFLg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehvddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgesghdtreertddtjeenucfhrhhomheptehlhihsshgr ucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepffduud ffueffgeehieegjedtkefhudehheefudehlefftedtkeeitdegfefgleehnecukfhppeek gedrudekgedrvddvhedruddvieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehhihesrghlhihsshgrrdhish X-ME-Proxy: Received: from x220.qyliss.net (p54b8e17e.dip0.t-ipconnect.de [84.184.225.126]) by mail.messagingengine.com (Postfix) with ESMTPA id 5681C108005F; Fri, 26 Mar 2021 08:00:14 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 5D93FAEC; Fri, 26 Mar 2021 12:00:13 +0000 (UTC) From: Alyssa Ross To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] stdio: fix vfscanf with matches longer than INT_MAX (bug 27650) In-Reply-To: <87blb7j59p.fsf@mid.deneb.enyo.de> References: <20210325140102.31043-1-hi@alyssa.is> <878s6bkuwy.fsf@mid.deneb.enyo.de> <87sg4j7zb5.fsf@alyssa.is> <87blb7j59p.fsf@mid.deneb.enyo.de> Date: Fri, 26 Mar 2021 12:00:08 +0000 Message-ID: <87czvm86rb.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 12:00:21 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Florian Weimer writes: >> Oh, thanks for telling me about fopencookie! I'd never have known about >> that otherwise. I've started having a go at a test case using it and it >> seems like it'll work well. > > Or you could test sscanf via on 64-bit > architectures. It would avoid the repeated memcpy calls, at the cost > of an initial strlen on the entire buffer. Would that be a problem on 32-bit? We'd only need to map INT_MAX bytes + 1 page, so the other half of the address space would be enough for everything else, wouldn't it? >> One question about the test: fscanf-ing through INT_MAX characters on a >> trivial memcpy-based fopencookie stream takes 20 seconds on my >> (admittedly fairly old) machine. How slow is too slow for a test? > > Opinions on that vary. Twenty seconds is stretching things as far as > I'm concerned. I guess it depends what you mean by =E2=80=9Cfairly old= =E2=80=9D. > > We have a second category of tests, xtests, that only run with =E2=80=9Cm= ake > xcheck=E2=80=9D. We could put the test there if it takes too long to run > otherwise. That machine is a laptop from 2012. On my other laptop, from 2017, it takes <5 seconds, and the fopencookie and blob_repeat versions aren't really distinguishable from each other in terms of time taken. I would like to go with the blob_repeat version if it'll work everywhere, though, because not having to write a custom stream implementation makes the test a lot shorter and easier to understand. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmBdzMoACgkQ+dvtSFmy ccBcxhAAnIuedR+9Mvk6VyHdkKAE7K2IdS7mGRs+XU7SgTFoWRT7heidG812SCfE UbuiE64JcuIvOtKxmYjwRBvQw0TZpng4sEvAoheJyUe5Nf3pizg+8Qyshmof82pO rNQn9NlgTwEk2qJwUm5NqQM05KlOXAk50XqApeLrxfYOX83OCPzLUAlWez8cXDOf KALKFifV8CoUJdKdhYjTpXePwAYECeHWPCvlu13GbI6jsA8kouhjjwhS2aqcUuWZ /6slNGUCh8yZLrBP4e6/VNebRnSw57J9N/U8rax1pcOfBTYQjV8dkokXTFfxhOnN TEoK8hYdd0i9zadO/ogug+3wcRP33N2HewIu27+g0xY8koQiVjuwwTgTX4v64NAf CPCxQH1tYf0i63MapebwBYuqSQwXy6WADE88OUX1sfLY2EUpvVPH4cQSLvruzc8a u0FJqqvLOVj2jmTUb5yDvyOOipZbFiI/592AjL8DzYJ1xFeqXYuErigKyWOT2sxu cRjYMl5GaSc3MNCmO7O+1LaleeEKpzyRnbBhL9JQmAIXie/fHrjskCcODSGr+eHa 8S03nMjbUCLNbqzBiRriOTnVaCYEPYBDV3YmBnO50wNbxaIz0Fo6rP8UDkomb78C iqITHJSvCmkqgzK4CHbVslLl1y+p484NS5CVDsHQ5+TdNR08cZM= =/IPZ -----END PGP SIGNATURE----- --=-=-=--