From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19846 invoked by alias); 17 Oct 2013 19:31:31 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 19794 invoked by uid 48); 17 Oct 2013 19:31:28 -0000 From: "bugdal at aerifal dot cx" To: glibc-bugs@sourceware.org Subject: [Bug libc/16060] New: dprintf fails to be async-signal safe Date: Thu, 17 Oct 2013 19:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: bugdal at aerifal dot cx X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg00209.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16060 Bug ID: 16060 Summary: dprintf fails to be async-signal safe Product: glibc Version: unspecified Status: NEW Severity: enhancement Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: bugdal at aerifal dot cx CC: drepper.fsp at gmail dot com This is NOT a conformance bug, as POSIX does not require dprintf to be AS-safe or even mention it as an option. However, Roland McGrath has stated on libc-alpha that, as the original inventor of this interface, he intended it to be AS-safe and in general not to have unnecessary failure cases. At present, dprintf fails to be AS-safe for at least the following reasons: 1. It adds and removes the temporary FILE structure it creates to/from the global open streams list, requiring a lock. This operation is entirely unnecessary and nonsensical (and also documented in bug #12847). 2. The printf core uses malloc in various places (wide string conversion, i18n %n$ arguments, ...). Fixing these uses is less trivial, and may not matter to the most common usage cases for dprintf which are unlikely to hit the code paths that use malloc, but they are bugs in themselves anyway (unnecessary failure cases for the entire printf family) which should be fixed. There may also be other AS-safety issues I am unaware of. -- You are receiving this mail because: You are on the CC list for the bug.