From patchwork Wed Oct 7 10:13:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 527225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 66673140273 for ; Wed, 7 Oct 2015 21:14:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qZKeLNkc; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=R0qKsGHy15L4wIFI YreUnEmM6/HdbvPMPCuTnk3QP7QPiHcuCmmsmCZF/g1ILrwnJZ5Iny6hfnJT1Cjn Hz5hT0N0L1mn1sSsiAy1tOSpLV81jWRmFoi1d3P+5aWcV9w5aL1LxtGDJQJaTeNp EQGkp8cXN3aMvOXT+9fcJdF8NJA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=ulUNTPLrxgyQTT9p50zt5O EirS0=; b=qZKeLNkcq3EfxZCv5e2dkqehJDpgQ19MIdYA9d6rIu4JRDOa+qGZSi HTuf9JZunkHgUR2Nhq8CG7preJ3jj6SDlC43HMcYCOoHI7WeKPoJYkhmOOetqOq4 8coKb4HmtAm+wq11+f53RrOYN3buREZxhVB8iezhugFhQ/47bfXlU= Received: (qmail 31414 invoked by alias); 7 Oct 2015 10:13:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31386 invoked by uid 89); 7 Oct 2015 10:13:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Oct 2015 10:13:57 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZjljM-0006Iy-TY from Thomas_Schwinge@mentor.com ; Wed, 07 Oct 2015 03:13:53 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 7 Oct 2015 11:13:51 +0100 From: Thomas Schwinge To: Andreas Schwab , , Jakub Jelinek CC: , , , Subject: abort might not flush all open streams before process termination (was: aarch64-suse-linux-gnu: libgomp.oacc-c-c++-common/abort-1.c, libgomp.oacc-c-c++-common/abort-3.c FAILs) In-Reply-To: References: <560e717f.+EOSyvrXa02mQ6Bg%schwab@linux-m68k.org> <87twq4p9f4.fsf@kepler.schwinge.homeip.net> <87oagcp6kc.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Wed, 7 Oct 2015 12:13:41 +0200 Message-ID: <871td7ouju.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! Copying glibc for your information/in case anyone has any further comments, and the man-pages maintainer, Michael Kerrisk. The issue is that abort might not flush all open streams before process termination; original thread starting at . On Tue, 06 Oct 2015 13:55:00 +0200, Andreas Schwab wrote: > Thomas Schwinge writes: > > > | The two regressed test cases use __builtin_printf instead of fprintf to > > | stderr, but as far as I know, abort is to flush all open streams before > > | process termination? > > It can't, since abort must be async-signal-safe. It's still surprising to me that the message written to stderr is lost in your aarch64-suse-linux-gnu configuration (only): from a quick look, (current) glibc's stdlib/abort.c tries to actually close/flush all open streams before process termination. This is also what's documented on : "all open streams are closed and flushed". does sound more "conservative": "[abort] may include an attempt to effect fclose() on all open streams". Should the man-page be edited to that effect? And, the following patch be applied to GCC? commit e270bce5dadf61b838706c4cfb824fa9dd22fb93 Author: Thomas Schwinge Date: Wed Oct 7 11:52:15 2015 +0200 abort might not flush all open streams before process termination libgomp/ * testsuite/libgomp.oacc-c-c++-common/abort-1.c: Print to stderr. * testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise. --- libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c | 3 ++- libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Grüße, Thomas diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c index 6a9b1df..296708f 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c @@ -1,11 +1,12 @@ /* { dg-do run } */ +#include #include int main (void) { - __builtin_printf ("CheCKpOInT\n"); + fprintf (stderr, "CheCKpOInT\n"); #pragma acc parallel { abort (); diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c index 2c8f347..bca425e 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c @@ -1,11 +1,12 @@ /* { dg-do run } */ +#include #include int main (void) { - __builtin_printf ("CheCKpOInT\n"); + fprintf (stderr, "CheCKpOInT\n"); #pragma acc kernels { abort ();