Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 148157 Details for
Bug 228936
getpwuid_r causes a multi threads program core dump
[?]
New
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.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Test program
test_getpwuid.c (text/plain), 1.97 KB, created by
Yi Zhou
on 2007-02-15 22:58:41 UTC
(
hide
)
Description:
Test program
Filename:
MIME Type:
Creator:
Yi Zhou
Created:
2007-02-15 22:58:41 UTC
Size:
1.97 KB
patch
obsolete
>#include <string.h> >#include <stdio.h> >#include <stdlib.h> >#include <pwd.h> >#include <errno.h> >#include <pthread.h> >#include <unistd.h> > >static void * testgetpwuid_r(void * x) >{ > int uid = geteuid(); > struct passwd pwd; > struct passwd* p = NULL; > int pwd_buff_size = 1024; > char buf[pwd_buff_size]; > > errno = 0; > int result = getpwuid_r(uid, &pwd, buf, pwd_buff_size, &p); > > if (result != 0) > { > printf("getpwuid_r failed: %s\n", strerror(result)); > exit(1); > } > else > { > if (p == NULL) > { > printf("getpwuid_r return 0 and errno = %d\n", errno); > exit(1); > } > else > { > printf("user is %s\n", p->pw_name); > } > } >} > >int main(int argc, char **argv) >{ > printf("This is a test\n"); > > pthread_t t1; > pthread_t t2; > pthread_t t3; > pthread_t t4; > pthread_t t5; > pthread_t t6; > pthread_t t7; > pthread_t t8; > pthread_t t9; > pthread_t t10; > > pthread_create(&t1, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t2, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t3, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t4, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t5, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t6, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t7, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t8, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t9, NULL, testgetpwuid_r, (void *) 1); > pthread_create(&t10, NULL, testgetpwuid_r, (void *) 1); > > pthread_join(t1, NULL); > pthread_join(t2, NULL); > pthread_join(t3, NULL); > pthread_join(t4, NULL); > pthread_join(t5, NULL); > pthread_join(t6, NULL); > pthread_join(t7, NULL); > pthread_join(t8, NULL); > pthread_join(t9, NULL); > pthread_join(t10, NULL); > > printf ("Test finished successfully\n"); > return 0; >} >
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228936
: 148157