[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: change misc/printf-surprise so that it doesn't segfault a
From: |
Jim Meyering |
Subject: |
[PATCH] tests: change misc/printf-surprise so that it doesn't segfault anymore |
Date: |
Sun, 16 Nov 2008 12:13:37 +0100 |
Now that I know the cause, I've worked around it:
>From b3e779c090bd6b3ebbd2e811b71891261ce85a9c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 16 Nov 2008 09:53:48 +0100
Subject: [PATCH 1/2] tests: change misc/printf-surprise so that it doesn't
segfault anymore
* tests/misc/printf-surprise: Disable MALLOC_PERTURB_, so that "make
check" no longer provokes a segfault from printf(1). Before, that
would be detected as a known problem and cause the test to be skipped.
Adjust the test so that a segfault once again results in test failure.
---
tests/misc/printf-surprise | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tests/misc/printf-surprise b/tests/misc/printf-surprise
index b24e3be..34f6864 100755
--- a/tests/misc/printf-surprise
+++ b/tests/misc/printf-surprise
@@ -54,6 +54,10 @@ fail=0
mkfifo fifo || framework_failure
+# Disable MALLOC_PERTURB_, to avoid triggering this bug
+# http://bugs.debian.org/481543#77
+export MALLOC_PERTURB_=0
+
head -c 10 fifo > out &
( ulimit -v 10000; env $prog %20000000f 0 2>err-msg > fifo )
exit=$?
@@ -78,9 +82,10 @@ case $n_out:$diagnostic:$exit in
10:n:0) ;; # ok, succeeds w/no diagnostic: FreeBSD 6.1
0:y:1) ;; # ok, glibc-2.8 and newer, when printf(3) fails with ENOMEM
- *:139) # segfault; known bug at least in debian unstable's libc6 2.7-11
- echo 1>&2 "$0: bug in snprintf causes low-mem use of printf to segfault"
- fail=77;;
+ # With MALLOC_PERTURB_=0, this no longer happens.
+ # *:139) # segfault; known bug at least in debian unstable's libc6 2.7-11
+ # echo 1>&2 "$0: bug in snprintf causes low-mem use of printf to segfault"
+ # fail=77;;
# 10:y) ;; # Fail: doesn't happen: nobody succeeds with a diagnostic
# 0:n) ;; # Fail pre-patch: no output, no diag
--
1.6.0.4.983.ga2771
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] tests: change misc/printf-surprise so that it doesn't segfault anymore,
Jim Meyering <=