aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.cth
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2006-11-10 18:42:28 +0000
committerFrank Ch. Eigler <fche@gcc.gnu.org>2006-11-10 18:42:28 +0000
commitf70d742fc89c922a9ad5508753027eb17827369c (patch)
treef1e9d593de06af753a78e3763ac0ae92abff57ec /libmudflap/testsuite/libmudflap.cth
parenta6b03a63d60ea2c720d2351812dee479b9137183 (diff)
downloadgcc-f70d742fc89c922a9ad5508753027eb17827369c.zip
gcc-f70d742fc89c922a9ad5508753027eb17827369c.tar.gz
gcc-f70d742fc89c922a9ad5508753027eb17827369c.tar.bz2
re PR libmudflap/28578 (A most simple multithreaded program (practically any multithreaded one) causes mudflap violation)
2006-11-10 Frank Ch. Eigler <fche@redhat.com> PR libmudflap/28578 * mf-hooks1.c (__mf_0fn_malloc): Make the bootstrap buffers static but not function scope static. (free): Skip deallocation attempts for objects placed into bootstrap buffers. * testsuite/libmudflap.cth/pass59-frag.c: New test. M libmudflap/mf-hooks1.c M libmudflap/ChangeLog A libmudflap/testsuite/libmudflap.cth/pass59-frag.c From-SVN: r118662
Diffstat (limited to 'libmudflap/testsuite/libmudflap.cth')
-rw-r--r--libmudflap/testsuite/libmudflap.cth/pass59-frag.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.cth/pass59-frag.c b/libmudflap/testsuite/libmudflap.cth/pass59-frag.c
new file mode 100644
index 0000000..bf6c293
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.cth/pass59-frag.c
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <pthread.h>
+
+/* PR 28578 */
+
+void* test_thread(void* arg)
+{
+ printf("Hello from thread!\n");
+ pthread_exit(NULL);
+ return 0;
+}
+
+int main()
+{
+ pthread_t thread;
+ int arg = 0;
+ pthread_create(&thread, NULL, test_thread, (void*)arg);
+ pthread_join(thread, NULL);
+ pthread_exit(NULL);
+ return 0;
+}
+
+/* { dg-output "Hello from thread!\n" } */
+
+#if 0
+
+/* Even this test case replicates the problem. However, when built in
+ static mode, it blows up during __mf_init (?!?!?!) with a
+ pthread_mutex_lock deadlock error. */
+
+#include <stdio.h>
+#include <pthread.h>
+
+int main ()
+{
+ pthread_exit(NULL);
+ return 0;
+}
+#endif