From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13038 Path: news.gmane.org!.POSTED!not-for-mail From: Christopher Friedt Newsgroups: gmane.linux.lib.musl.general Subject: Re: Possible oversight in setvbuf() Date: Fri, 13 Jul 2018 18:19:30 -0400 Message-ID: References: <20180713144052.GA13099@voyager> <20180713213110.GD1392@brightrain.aerifal.cx> <20180713220606.GE1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004d19a10570e8e038" X-Trace: blaine.gmane.org 1531520271 16874 195.159.176.226 (13 Jul 2018 22:17:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2018 22:17:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13054-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jul 14 00:17:47 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fe6Nl-0004I0-Ag for gllmg-musl@m.gmane.org; Sat, 14 Jul 2018 00:17:45 +0200 Original-Received: (qmail 25902 invoked by uid 550); 13 Jul 2018 22:19:54 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 25884 invoked from network); 13 Jul 2018 22:19:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=eTF+zc6kAiZjEPoRMwmUFfHB99NrBUm+8hIHibVacqQ=; b=IXIfKb2OELF+IxQ6urP/gn+uvN3dTBkBPKICiiBeXaNtnLeKDmBB5W2xXsAOhl8Ysd 9R/HN3Zbng42TYbrfVWkBZ5vHjjFOgca+QzQt8bdGfhtzZtTU0yM/aYjyHPiJOiThJkv 4tcyEDHx0dJTB0nCbvKa+TwvNND3lKzPwll9fTmSRgPrt6dDboFKO2z9kG0glums6w0x PiBuVErzIKnPjYkQHXSpCM2myzlug16lQWSb/BXdhEnnzJ8shyLP6J6Ja/OCCNvc1gcR lm8NdFDRo4pEQgkjtde5He9nKPk/nY1HR9uqF2KWZBhzp+ZFCZYYjII6kqK4/fj43Pmn vrPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=eTF+zc6kAiZjEPoRMwmUFfHB99NrBUm+8hIHibVacqQ=; b=gOcD02Izh/jyGYJ0KF2LefvNjOms0nc1xWCruAA0LClKjP5gIyf1G35s560lI/2m78 gZJCj+cPToew4GBWuyYcilH+7CJEvBRTL6XM+ppoKICVTOTUC33OuotmTBrB5jT7vZRm JDMsz4eBM5yGMsoBZmbjBv3Gd3E7cMXdDoHSXkgI+hEh6+pDjWfWHpfnmj2xnpmwpvkG nlSwiNhCmZlRnHgsRS8Z9O+T0P/wOQwfFd2I9RNw27+pH9dkJ8L0yALJ5hVK2boNbkC3 vqTQ8xG1f8KhS/pYG71/D/7eFqdW8nvkp2QM/UZuBFVMIcVG+3Nd0+/maHx61zGnCB1R mG2A== X-Gm-Message-State: AOUpUlFXM6ro/GlkUh73x/MmjIABfEDRjkXIxVd2PSWzvW9Fpi6C2uyy MJJLZ3lpOEMCfVSlbW8Ga9gCTLi9y4yUETfLmls2uA== X-Google-Smtp-Source: AAOMgpc9odIGW8sRE4pbZdEKznRsgkD1ULi9mGM7sXJs+AyeXKPI1GKdRqcAm0ApAh13mxX+s24jfMGNRomlIpCyL+w= X-Received: by 2002:aca:4d87:: with SMTP id a129-v6mr9598485oib.256.1531520381424; Fri, 13 Jul 2018 15:19:41 -0700 (PDT) In-Reply-To: <20180713220606.GE1392@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13038 Archived-At: --0000000000004d19a10570e8e038 Content-Type: text/plain; charset="UTF-8" On Fri, Jul 13, 2018, 6:06 PM Rich Felker, wrote: > On Fri, Jul 13, 2018 at 05:46:54PM -0400, Christopher Friedt wrote: > > A good process for adding new features is to add tests with them. Even if > > there is only a test for expected behaviour, at least it will catch one > > possible regression. > > Yes, I should really do that more. Sometimes it's not obvious what > should be tested though. In the case of setvbuf, the intended behavior > is in some sense untestable (the previous implementation not using the > caller-provided buffer was valid); in hindsight the obvious important > thing to test is that it doesn't result in writes outside the buffer. > If you need more than that basic test.c program that I provided before for addrconfig, i'd be happy to add some more test cases. > --0000000000004d19a10570e8e038 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


= On Fri, Jul 13, 2018, 6:06 PM Rich Felker, <dalias@libc.org> wrote:
On Fri, Jul 13, 2018 at 05:46:54PM -0400, Christopher Friedt wrote:
> A good process for adding new features is to add tests with them. Even= if
> there is only a test for expected behaviour, at least it will catch on= e
> possible regression.

Yes, I should really do that more. Sometimes it's not obvious what
should be tested though. In the case of setvbuf, the intended behavior
is in some sense untestable (the previous implementation not using the
caller-provided buffer was valid); in hindsight the obvious important
thing to test is that it doesn't result in writes outside the buffer.

If= you need more than that basic test.c program that I provided before for ad= drconfig, i'd be happy to add some more test cases.
--0000000000004d19a10570e8e038--