From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10798 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Handling of L and ll prefixes different from glibc Date: Wed, 14 Dec 2016 21:30:42 -0500 Message-ID: <20161215023042.GW1555@brightrain.aerifal.cx> References: <20161214161348.GU1555@brightrain.aerifal.cx> <20161214171756.GH16379@port70.net> <5851C9C3.6050609@adelielinux.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1481769057 9054 195.159.176.226 (15 Dec 2016 02:30:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Dec 2016 02:30:57 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10811-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 15 03:30:54 2016 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 1cHLor-0001jN-8a for gllmg-musl@m.gmane.org; Thu, 15 Dec 2016 03:30:53 +0100 Original-Received: (qmail 9235 invoked by uid 550); 15 Dec 2016 02:30:55 -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 8190 invoked from network); 15 Dec 2016 02:30:55 -0000 Content-Disposition: inline In-Reply-To: <5851C9C3.6050609@adelielinux.org> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10798 Archived-At: On Wed, Dec 14, 2016 at 04:37:55PM -0600, A. Wilcox wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 14/12/16 11:17, Szabolcs Nagy wrote: > > * Rich Felker [2016-12-14 11:13:48 -0500]: > >> behavior. I'm mildly leaning towards causing a crash on invalid > >> format strings so that the location of the incorrect usage can be > >> quickly found with a debugger, but I'd like feedback from users > >> who've debugged this sort of thing on whether that'd actually be > >> helpful. > > > > crashing sounds good to me. > > > > Would this be able to be configured in some way when building the libc > (-D_CRASH_ON_PRINTF_UB or such)? > > This sounds like a great tool to use when doing conformance testing, > and in general once testing has been done. However, it also sounds > like a great way to break packages already "working" on musl. While that's possible, I _really_ prefer avoiding switches like this. It's a path that leads to maintenance-death of a project. It's true that some programs which are just misusing printf format specifiers as part of unnecessary status/debug/junk output will fully work now, despite having UB, and that they would stop working with such a change. But in most cases, the lack of output now, even if it's unnoticed, is a bug that could have serious consequences. For example missing output in text that's parsed and used in a script can lead to things like rm -rf'ing the wrong directory. So I tend to think always failing hard and catching the bug is preferable. BTW I wonder if gcc's -Wformat catches these errors. Rich