about summary refs log tree commit diff
path: root/debug/chk_fail.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-13 03:13:00 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-13 03:13:00 +0000
commita9055cab7ac609b96984179194c7a2ec410c8e2b (patch)
treed7bbccb32e96d87220932549049a48f3eb5c3dad /debug/chk_fail.c
parent1327439fc6ef182c3ab8c69a55d3bee15b3c62a7 (diff)
downloadglibc-a9055cab7ac609b96984179194c7a2ec410c8e2b.tar.gz
glibc-a9055cab7ac609b96984179194c7a2ec410c8e2b.tar.xz
glibc-a9055cab7ac609b96984179194c7a2ec410c8e2b.zip
Update.
2004-11-12  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/libc_fatal.c: Add new function __libc_message
	which performs the printing and simple format string handling.  The
	string is written to tty, stderr, syslog in this order, stopping after
	the first successful output.
	(__libc_fatal): Call __libc_message.
	* include/stdio.h: Declare __libc_message.
	* malloc/malloc.c (malloc_printerr): Use __libc_message.
	* debug/chk_fail.c: Also print message with __libc_message.
	* debug/test-strcpy_chk.c: Ensure that debug messages are not printed
	to the terminal or stderr.
	* debug/tst-chk1.c: Likewise.

	* posix/Makefile: Remove gpl2lgpl variable.
Diffstat (limited to 'debug/chk_fail.c')
-rw-r--r--debug/chk_fail.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/debug/chk_fail.c b/debug/chk_fail.c
index 48848fbe35..dc1c3d70b6 100644
--- a/debug/chk_fail.c
+++ b/debug/chk_fail.c
@@ -1,3 +1,4 @@
+
 /* Copyright (C) 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -16,23 +17,14 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <abort-instr.h>
 
 
 void
 __attribute__ ((noreturn))
 __chk_fail (void)
 {
-  while (1)
-    {
-      /* This will leave a nice backtrace.  */
-      abort ();
-#ifdef ABORT_INSTRUCTION
-      ABORT_INSTRUCTION;
-#endif
-      _exit (127);
-    }
+  __libc_fatal ("*** buffer overflow detected ***\n");
 }
 libc_hidden_def (__chk_fail)