X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31C07385803F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1637586281;
	bh=hspRKAAIQCeELl0iBUybyqiwH5VPNCFuKhjWpExdxio=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=Qyw95MI0HINMAhIx6Ad/I74le5lrVFknPhwww46jjmQAWWjOTJhdd8ucQJsm7SK3v
	 /BHHAUYQxyGFzJrUWsdXle8Y8CRXbGKnl+hMhL3FJe2Vi9NfOYfcoLcf6yAZHWfSEK
	 0ihXdZmlQhLOYv94Tig+8Cx9PuG542VjwfFCI41o=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3819D3858415
Date: Mon, 22 Nov 2021 14:04:06 +0100
To: cygwin@cygwin.com
Subject: Re: possible snprintf() regression in 3.3.2
Message-ID: <YZuVRjYoG40cEGDV@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <20211117182108.b38599f5e13071bf269a0d48@nifty.ne.jp>
 <YZT1S8wDnaBuYf5u@calimero.vinschen.de>
 <20211118000649.GG10332@venus.tony.develop-help.com>
 <20211118203538.a049809d57731fe375801c15@nifty.ne.jp>
 <YZZSzPhbqF6cQAiu@calimero.vinschen.de>
 <fa647f83-c5ed-6dea-fcba-c8b799abe12f@gmail.com>
 <YZZi3rI5msk6ksAV@calimero.vinschen.de>
 <7545bb24-43de-cd7d-0764-55c85f1af957@gmx.com>
 <20211121001613.GH10332@venus.tony.develop-help.com>
 <YZtyJDXdrMzVR2lJ@calimero.vinschen.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <YZtyJDXdrMzVR2lJ@calimero.vinschen.de>
X-Provags-ID: V03:K1:tK/65jEmTZ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required=5.0 tests=BAYES_00,
 GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT,
 RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL,
 TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On Nov 22 11:34, Corinna Vinschen via Cygwin wrote:
> On Nov 21 11:16, Tony Cook wrote:
> > On Thu, Nov 18, 2021 at 09:08:40PM +0000, Sam Edge via Cygwin wrote:
> > > I use newlib on embedded with threading libs that have predetermined
> > > fixed thread stack sizes. While we tend to have more RAM than in former
> > > times we also have multiple thread stacks. Use of alloca() or variable
> > > length automatic arrays makes me wince especially in code I might not be
> > > able to avoid calling which is often the case with XXXprintf() in
> > > third-party libraries' debug output. I'd usually rather take the
> > > performance hit from using heap instead of having to make all my stacks
> > > bigger.
> > 
> > A simple option would be to use an small auto fixed buffer for most
> > conversions, but use malloc() for %f formats for numbers greater in
> > magnitude than some limit, though it would also need to be adjusted
> > for the precision (ndigits here), since they take extra space.
> > 
> > This would avoid using the optional-to-implement VLA feature too.
> 
> Good idea.  I guess I create a simple fix doing just that.

I created a patch:
https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=68faeef4be71

Please test the latest developer snapshot from http://cygwin.com/snapshots/


Thanks,
Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
