Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 522617 Details for
Bug 737387
strange pthread/fork deadlock
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
test case demonstrating the issue
test.c (text/x-csrc), 810 bytes, created by
Allison Karlitskaya
on 2011-09-11 17:56:01 UTC
(
hide
)
Description:
test case demonstrating the issue
Filename:
MIME Type:
Creator:
Allison Karlitskaya
Created:
2011-09-11 17:56:01 UTC
Size:
810 bytes
patch
obsolete
>#include <sys/syscall.h> >#include <sys/wait.h> >#include <stdlib.h> >#include <unistd.h> >#include <pthread.h> >#include <stdbool.h> >#include <stdio.h> > >#define N_THREADS 100 > >static void * >worker (void *arg) >{ > pid_t pid; > >#ifdef FORK_DIRECTLY > pid = syscall (SYS_fork); >#else > pid = fork (); >#endif > > if (pid == -1) > abort (); > > if (pid == 0) > { > char *args[] = { "/bin/true", NULL }; > execv ("/bin/true", args); > abort (); > } > > waitpid (pid, NULL, 0); > > return NULL; >} > >int >main (void) >{ > pthread_t threads[N_THREADS]; > int i; > > while (true) > { > for (i = 0; i < N_THREADS; i++) > pthread_create (&threads[i], NULL, worker, NULL); > > for (i = 0; i < N_THREADS; i++) > pthread_join (threads[i], NULL); > > putchar ('.'); > fflush (stdout); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 737387
: 522617