From: Jack Steiner <steiner@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] glibc bug / pthread bug???
Date: Tue, 01 Oct 2002 20:08:01 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590701906079@msgid-missing> (raw)
Has anyone seen this problem or know enough about glibc/threads
to have a good idea about what is busted.
The test case listed below consistently hang using 2.4.18 & glibc-2.2.4-19.3.
If only one instance (fork=1)of the test is run, it runs ok. If multiple copies
of the test are run, it hangs in:
* rt_sigsuspend
* __sigsuspend
* __pthread_wait_for_restart_signal
* pthread_cond_wait
* thread_func
* pthread_start_thread
Has anyone seen this???
/*
* compile with
* gcc -g -Wall -o test test.c -lrt
*
* execute
* test [<inner_loop_count> [<outer_loop_count>]]
*
*
* Test creates timer threads that hang in
* rt_sigsuspend
* __sigsuspend
* __pthread_wait_for_restart_signal
* pthread_cond_wait
* thread_func
* pthread_start_thread
*
*/
#include <signal.h>
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/times.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int forks=5;
int count=5;
void *
slave(void)
{
timer_t timerid;
pid_t pid;
int i, status;
for (i=0; i<forks; i++) {
if (fork() = 0) {
if (timer_create(CLOCK_REALTIME, NULL, &timerid) = -1) {
perror("timer_create");
exit(1);
}
execlp("/bin/date", "date", (char *)0);
}
pid = wait(&status);
}
exit(0);
}
int
main (int argc, char *argv[])
{
int i;
count = argc >= 2 ? atoi(argv[1]) : 5;
forks = argc >= 3 ? atoi(argv[2]) : 5;
for (i=0; i<count; i++) {
if (fork() = 0)
slave();
}
exit(0);
}
--
Thanks
Jack Steiner (651-683-5302) (vnet 233-5302) steiner@sgi.com
next reply other threads:[~2002-10-01 20:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 20:08 Jack Steiner [this message]
2002-10-01 21:28 ` [Linux-ia64] glibc bug / pthread bug??? Boehm, Hans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590701906079@msgid-missing \
--to=steiner@sgi.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.