]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add (presently) failing test case for bz#234814.
authorRhys Kidd <rhyskidd@gmail.com>
Sat, 23 May 2015 10:20:06 +0000 (10:20 +0000)
committerRhys Kidd <rhyskidd@gmail.com>
Sat, 23 May 2015 10:20:06 +0000 (10:20 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15282

none/tests/Makefile.am
none/tests/bug234814.c [new file with mode: 0644]
none/tests/bug234814.stderr.exp [new file with mode: 0644]
none/tests/bug234814.stdout.exp [new file with mode: 0644]
none/tests/bug234814.vgtest [new file with mode: 0644]

index 4c35f65137590ebca854afde6c23ea82ab6f700f..1dfcfc498dc6f2b3674c51c8113bafe7e4d5994a 100644 (file)
@@ -77,6 +77,7 @@ EXTRA_DIST = \
        bigcode.vgtest bigcode.stderr.exp bigcode.stdout.exp \
        bitfield1.stderr.exp bitfield1.vgtest \
        bug129866.vgtest bug129866.stderr.exp bug129866.stdout.exp \
+       bug234814.vgtest bug234814.stderr.exp bug234814.stdout.exp \
        closeall.stderr.exp closeall.vgtest \
        cmdline0.stderr.exp cmdline0.stdout.exp cmdline0.vgtest \
        cmdline1.stderr.exp cmdline1.stdout.exp cmdline1.vgtest \
@@ -182,7 +183,7 @@ check_PROGRAMS = \
        ansi args \
        async-sigs \
        bitfield1 \
-       bug129866 \
+       bug129866 bug234814 \
        closeall coolo_strlen \
        discard exec-sigmask execve faultstatus fcntl_setown \
        fdleak_cmsg fdleak_creat fdleak_dup fdleak_dup2 \
diff --git a/none/tests/bug234814.c b/none/tests/bug234814.c
new file mode 100644 (file)
index 0000000..9171b13
--- /dev/null
@@ -0,0 +1,30 @@
+/* Refer https://bugs.kde.org/show_bug.cgi?id=234814
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+
+const char kSigbus[] = "I caught the SIGBUS signal!\n";
+
+int GLOB = 3;
+
+void mysigbus() {
+   write(2, kSigbus, sizeof(kSigbus));
+   GLOB--;
+   return;
+}
+
+int main() {
+   struct sigaction sa;
+   sa.sa_handler = mysigbus;
+   sigemptyset(&sa.sa_mask);
+   sa.sa_flags = 0;
+   if (sigaction(SIGBUS, &sa, NULL) == -1) {
+      perror("ERROR:");
+   }
+   while(GLOB) {
+      kill(getpid(), SIGBUS);
+   };
+   return 0;
+} 
\ No newline at end of file
diff --git a/none/tests/bug234814.stderr.exp b/none/tests/bug234814.stderr.exp
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/none/tests/bug234814.stdout.exp b/none/tests/bug234814.stdout.exp
new file mode 100644 (file)
index 0000000..66c57f8
--- /dev/null
@@ -0,0 +1,3 @@
+I caught the SIGBUS signal!
+I caught the SIGBUS signal!
+I caught the SIGBUS signal!
diff --git a/none/tests/bug234814.vgtest b/none/tests/bug234814.vgtest
new file mode 100644 (file)
index 0000000..67a28e6
--- /dev/null
@@ -0,0 +1 @@
+prog: bug234814