diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-12-08 04:16:20 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-12-08 04:16:20 +0000 |
commit | 88e501796de76b5e610e88a164f6a5e7f5db5f99 (patch) | |
tree | 781fa5c15e0a3af75811501207c03c11e93152be /regress | |
parent | 0e201a5dfc0dc465044ac5c83a1e654c2a4734b2 (diff) |
comment out bogus portion of test until I figure
a better way to test the condition it is trying
to test. Solves malloc.conf -> J problem.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libc_r/fork/fork.c | 12 | ||||
-rw-r--r-- | regress/lib/libpthread/fork/fork.c | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/regress/lib/libc_r/fork/fork.c b/regress/lib/libc_r/fork/fork.c index b560cf20fa8..3a5d9ac24cd 100644 --- a/regress/lib/libc_r/fork/fork.c +++ b/regress/lib/libc_r/fork/fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fork.c,v 1.2 2001/09/20 16:43:15 todd Exp $ */ +/* $OpenBSD: fork.c,v 1.3 2002/12/08 04:16:19 marc Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -99,8 +99,18 @@ main() ASSERT(getpid() != parent_pid); /* Our sleeper thread should have disappeared */ printf("sleeper should have disappeared\n"); + + /* + * The following is bogus. The sleeper thread was + * freed before the fork returned. Calling pthread_join + * dereferences the 'sleeper_thread' pointer which no + * longer points to a valid thread structure. If the + * function returns ESRCH it's only because the freed + * memory hasn't been reused yet. ASSERT(ESRCH == pthread_join(sleeper_thread, &result)); printf("sleeper disappeared correctly\n"); + */ + /* Test starting another thread */ CHECKr(pthread_create(&sleeper_thread, NULL, empty, NULL)); sleep(1); diff --git a/regress/lib/libpthread/fork/fork.c b/regress/lib/libpthread/fork/fork.c index b560cf20fa8..3a5d9ac24cd 100644 --- a/regress/lib/libpthread/fork/fork.c +++ b/regress/lib/libpthread/fork/fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fork.c,v 1.2 2001/09/20 16:43:15 todd Exp $ */ +/* $OpenBSD: fork.c,v 1.3 2002/12/08 04:16:19 marc Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -99,8 +99,18 @@ main() ASSERT(getpid() != parent_pid); /* Our sleeper thread should have disappeared */ printf("sleeper should have disappeared\n"); + + /* + * The following is bogus. The sleeper thread was + * freed before the fork returned. Calling pthread_join + * dereferences the 'sleeper_thread' pointer which no + * longer points to a valid thread structure. If the + * function returns ESRCH it's only because the freed + * memory hasn't been reused yet. ASSERT(ESRCH == pthread_join(sleeper_thread, &result)); printf("sleeper disappeared correctly\n"); + */ + /* Test starting another thread */ CHECKr(pthread_create(&sleeper_thread, NULL, empty, NULL)); sleep(1); |