* 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)
[not found] ` <mvm612k8b57.fsf@hawking.suse.de>
@ 2015-10-07 10:13 ` Thomas Schwinge
[not found] ` <871td7ouju.fsf-clhehnSHAb8h2wMQzzS6eAmar9SRMdY1rE5yTffgRl4@public.gmane.org>
2015-10-26 16:28 ` 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) Thomas Schwinge
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Schwinge @ 2015-10-07 10:13 UTC (permalink / raw)
To: Andreas Schwab, mtk.manpages, Jakub Jelinek
Cc: gcc, linux-man, gcc-patches, libc-alpha
[-- Attachment #1: Type: text/plain, Size: 2985 bytes --]
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
<http://news.gmane.org/find-root.php?message_id=%3C87twq4p9f4.fsf%40kepler.schwinge.homeip.net%3E>.
On Tue, 06 Oct 2015 13:55:00 +0200, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Thomas Schwinge <thomas@codesourcery.com> 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
<http://man7.org/linux/man-pages/man3/abort.3.html>: "all open streams
are closed and flushed".
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/abort.html>
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 <thomas@codesourcery.com>
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(-)
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 <stdio.h>
#include <stdlib.h>
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 <stdio.h>
#include <stdlib.h>
int
main (void)
{
- __builtin_printf ("CheCKpOInT\n");
+ fprintf (stderr, "CheCKpOInT\n");
#pragma acc kernels
{
abort ();
Grüße,
Thomas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: abort might not flush all open streams before process termination
[not found] ` <871td7ouju.fsf-clhehnSHAb8h2wMQzzS6eAmar9SRMdY1rE5yTffgRl4@public.gmane.org>
@ 2015-10-07 10:18 ` Andreas Schwab
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2015-10-07 10:18 UTC (permalink / raw)
To: Thomas Schwinge
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, Jakub Jelinek,
gcc-/MQLu3FmUzdAfugRpC6u6w, linux-man-u79uwXL29TY76Z2rM5mHXA,
gcc-patches-/MQLu3FmUzdAfugRpC6u6w,
libc-alpha-9JcytcrH/bA+uJoB2kUjGw
Thomas Schwinge <thomas-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org> writes:
> On Tue, 06 Oct 2015 13:55:00 +0200, Andreas Schwab <schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>> Thomas Schwinge <thomas-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org> 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 <https://sourceware.org/bugzilla/show_bug.cgi?id=15436>.
Andreas.
--
Andreas Schwab, schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 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)
2015-10-07 10:13 ` 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) Thomas Schwinge
[not found] ` <871td7ouju.fsf-clhehnSHAb8h2wMQzzS6eAmar9SRMdY1rE5yTffgRl4@public.gmane.org>
@ 2015-10-26 16:28 ` Thomas Schwinge
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2015-10-26 16:28 UTC (permalink / raw)
To: gcc-patches, mtk.manpages
Cc: gcc, linux-man, libc-alpha, Andreas Schwab, Jakub Jelinek
[-- Attachment #1: Type: text/plain, Size: 3903 bytes --]
Hi!
On Wed, 7 Oct 2015 12:13:41 +0200, I wrote:
> 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
> <http://news.gmane.org/find-root.php?message_id=%3C87twq4p9f4.fsf%40kepler.schwinge.homeip.net%3E>.
>
> On Tue, 06 Oct 2015 13:55:00 +0200, Andreas Schwab <schwab@linux-m68k.org> wrote:
> > Thomas Schwinge <thomas@codesourcery.com> 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.
That's <https://sourceware.org/PR15436>, Andreas told us.
> This is also what's documented on
> <http://man7.org/linux/man-pages/man3/abort.3.html>: "all open streams
> are closed and flushed".
> <http://pubs.opengroup.org/onlinepubs/9699919799/functions/abort.html>
> 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?
I convince myself that the GCC patch was obvious enough; committed in
r229382:
commit 005c2a97673312fa25486a70bd810b9a1b37d367
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon Oct 26 16:25:04 2015 +0000
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229382 138bc75d-0d04-0410-961f-82ee72b054a4
---
libgomp/ChangeLog | 3 +++
libgomp/testsuite/libgomp.oacc-c-c++-common/abort-1.c | 3 ++-
libgomp/testsuite/libgomp.oacc-c-c++-common/abort-3.c | 3 ++-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git libgomp/ChangeLog libgomp/ChangeLog
index fa9027b..afc49ae 100644
--- libgomp/ChangeLog
+++ libgomp/ChangeLog
@@ -1,5 +1,8 @@
2015-10-26 Thomas Schwinge <thomas@codesourcery.com>
+ * testsuite/libgomp.oacc-c-c++-common/abort-1.c: Print to stderr.
+ * testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.
+
* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
acc_device_nvidia usage.
* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
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 <stdio.h>
#include <stdlib.h>
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 <stdio.h>
#include <stdlib.h>
int
main (void)
{
- __builtin_printf ("CheCKpOInT\n");
+ fprintf (stderr, "CheCKpOInT\n");
#pragma acc kernels
{
abort ();
Grüße
Thomas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-26 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <560e717f.+EOSyvrXa02mQ6Bg%schwab@linux-m68k.org>
[not found] ` <87twq4p9f4.fsf@kepler.schwinge.homeip.net>
[not found] ` <mvmlhbg8e0g.fsf@hawking.suse.de>
[not found] ` <87oagcp6kc.fsf@kepler.schwinge.homeip.net>
[not found] ` <mvm612k8b57.fsf@hawking.suse.de>
2015-10-07 10:13 ` 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) Thomas Schwinge
[not found] ` <871td7ouju.fsf-clhehnSHAb8h2wMQzzS6eAmar9SRMdY1rE5yTffgRl4@public.gmane.org>
2015-10-07 10:18 ` abort might not flush all open streams before process termination Andreas Schwab
2015-10-26 16:28 ` 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) Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).