Andreas Schwab
f99cf3ddb6
- abort-no-flush.patch: Don't close or flush stdio streams on abort (BZ #15436) - fix-locking-in-_IO_cleanup.patch: always do locking when accessing streams (bnc#796982, BZ #15142) - resolv-dont-ignore-second-answer.patch: don't ignore second answer from nameserver if the first one was empty (bnc#767266, BZ #13651) - ldd-system-interp.patch: Never try to execute the file in ldd (bnc#677787, BZ #16750) - check-pf-alloca.patch: Account for alloca use when collecting interface addresses (bnc#785041, BZ #16002) - powerpc-opt-power8.patch: two more POWER8 optimisations (bnc#866711, fate#315443) - getaddrinfo-uninit-result.patch: Fix use of half-initialized result in getaddrinfo when using nscd (bnc#867636, BZ #16743) OBS-URL: https://build.opensuse.org/request/show/227472 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=343
81 lines
2.0 KiB
Diff
81 lines
2.0 KiB
Diff
Don't close or flush stdio streams on abort
|
|
|
|
[BZ #15436]
|
|
* stdlib/abort.c (abort): Don't call fflush and __fcloseall.
|
|
|
|
Index: glibc-2.19/stdlib/abort.c
|
|
===================================================================
|
|
--- glibc-2.19.orig/stdlib/abort.c
|
|
+++ glibc-2.19/stdlib/abort.c
|
|
@@ -30,9 +30,6 @@
|
|
# define ABORT_INSTRUCTION
|
|
#endif
|
|
|
|
-#include <libio/libioP.h>
|
|
-#define fflush(s) _IO_flush_all_lockp (0)
|
|
-
|
|
/* Exported variable to locate abort message in core files etc. */
|
|
struct abort_msg_s *__abort_msg __attribute__ ((nocommon));
|
|
libc_hidden_def (__abort_msg)
|
|
@@ -66,16 +63,8 @@ abort (void)
|
|
__sigprocmask (SIG_UNBLOCK, &sigs, (sigset_t *) NULL);
|
|
}
|
|
|
|
- /* Flush all streams. We cannot close them now because the user
|
|
- might have registered a handler for SIGABRT. */
|
|
- if (stage == 1)
|
|
- {
|
|
- ++stage;
|
|
- fflush (NULL);
|
|
- }
|
|
-
|
|
/* Send signal which possibly calls a user handler. */
|
|
- if (stage == 2)
|
|
+ if (stage == 1)
|
|
{
|
|
/* This stage is special: we must allow repeated calls of
|
|
`abort' when a user defined handler for SIGABRT is installed.
|
|
@@ -93,7 +82,7 @@ abort (void)
|
|
}
|
|
|
|
/* There was a handler installed. Now remove it. */
|
|
- if (stage == 3)
|
|
+ if (stage == 2)
|
|
{
|
|
++stage;
|
|
memset (&act, '\0', sizeof (struct sigaction));
|
|
@@ -103,30 +92,22 @@ abort (void)
|
|
__sigaction (SIGABRT, &act, NULL);
|
|
}
|
|
|
|
- /* Now close the streams which also flushes the output the user
|
|
- defined handler might has produced. */
|
|
- if (stage == 4)
|
|
- {
|
|
- ++stage;
|
|
- __fcloseall ();
|
|
- }
|
|
-
|
|
/* Try again. */
|
|
- if (stage == 5)
|
|
+ if (stage == 3)
|
|
{
|
|
++stage;
|
|
raise (SIGABRT);
|
|
}
|
|
|
|
/* Now try to abort using the system specific command. */
|
|
- if (stage == 6)
|
|
+ if (stage == 4)
|
|
{
|
|
++stage;
|
|
ABORT_INSTRUCTION;
|
|
}
|
|
|
|
/* If we can't signal ourselves and the abort instruction failed, exit. */
|
|
- if (stage == 7)
|
|
+ if (stage == 5)
|
|
{
|
|
++stage;
|
|
_exit (127);
|