From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by sourceware.org (Postfix) with ESMTPS id 3819D3858415 for ; Mon, 22 Nov 2021 13:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3819D3858415 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MplLZ-1mIr3S3gLN-00qAhm for ; Mon, 22 Nov 2021 14:04:07 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 9C274A80D7E; Mon, 22 Nov 2021 14:04:06 +0100 (CET) Date: Mon, 22 Nov 2021 14:04:06 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: possible snprintf() regression in 3.3.2 Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20211117182108.b38599f5e13071bf269a0d48@nifty.ne.jp> <20211118000649.GG10332@venus.tony.develop-help.com> <20211118203538.a049809d57731fe375801c15@nifty.ne.jp> <7545bb24-43de-cd7d-0764-55c85f1af957@gmx.com> <20211121001613.GH10332@venus.tony.develop-help.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:tK/65jEmTZdIDyCuBKt2veRB7iY8Wr8l+6ZEWEY613HJcqgVBor Saw9qZuSLTNcaQG8FWiqOejbCWPNOGTMcFhN8feMkyYlV+SWa4FG91Jh5xrcQkDLgyO2ezj Kmssu+jZnLT2S/pojOUBMPcS9a+mEXPdWGtcNSV0ajl3dWTIr6UFCuy8+Uk2WCl2CXjdJDM fK7ygbl7a/iH9cTfCE2sw== X-UI-Out-Filterresults: notjunk:1;V03:K0:so6P5z9t6NQ=:mDHj5MNrqREfXYUFPaEN2p xRMQUdB3Uw367L6L0PNH1yDHH8I1C/wEWnT4fkBIXu0ctOEPJqTSnu7g2btWnaaHnZ7qoIDhX +EQ3CTUQ2CZujk95aH/HmOJoynfIUy0sUNfHSaqCH05PfTnBS2UfYkfyDl2Ue5q7C2xAobhAQ X3dlC5HZYqst4WD2KfKo1vsxUNtoDxFcPvsrqHM/c5wb/g3EwTMlg4fqNI5NudWKOD1HXGo9i s0oxYcUMtXyhfBNPMvPz1QEN9ivhEU5O8RxDgKytHPSoVYC55uSbr4VFHfKipW0Uloo+MpNDE K5fY7jmKpERN+0sBt45po+PyLBZD+l6IeN0FpXVJJhTUKYVTbt7bG453E1u2VR055NGiOe++X 8tUAGnwoj33GRyqTYZUP8KE6t7jqlsPhp5IDzneKsdWuVRzHup9Gp3UcMG7dZ3EJceM8JnqNj ESN7mkjzK8wqm1KWymM4U4bNbHVHqXVXnHg9ZWE6dVOBUphBN9TFqqxzEQAa3ATa60PG+weWW EEaIyrKI/fIHgXcluRzAz71SoukkSAkuFWu36jgm7A+pGEq/wiDajfzo4N4kDhaTm4/Bwgz3x VpwHNaO6lB0UPJRxdwf44vMlkj2Bst/+zloO6rUj02eM1vpjPOa5IprkFs9v3pSn8xxjki2ht 3ZDgRwaFQMf299qiT5UBAPOUD+3TbHe9zz6TU/LZ6x3PAO6QyPF3FRFwbedw8WAfp8KzBXTHC 5FHRRONYg7/86y6m X-Spam-Status: No, score=-99.1 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 13:04:11 -0000 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