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 296546 Details for
Bug 435662
lockup in shrink_zone when node out of memory
[?]
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.
reproducer
repro-oom.C (text/plain), 1.61 KB, created by
Qian Cai
on 2008-03-03 05:15:35 UTC
(
hide
)
Description:
reproducer
Filename:
MIME Type:
Creator:
Qian Cai
Created:
2008-03-03 05:15:35 UTC
Size:
1.61 KB
patch
obsolete
>#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <stdlib.h> >#include <unistd.h> >#include <pthread.h> > >#include <iostream> > >#define BUFSIZE 10485760 >#define BUFFERS 1700 > >char *buffers[BUFFERS]; >int child_num=0; > >void *copy_block(void *); > >int main(int argc, char **argv){ > int order=0; > > // make 8 procs > while(order<7) > switch(fork()){ > case -1: > break; > default: > order++; > break; > case 0: > child_num=order; > order=8; > break; > } > > int random_fd=open("/dev/urandom",O_RDONLY); > if(random_fd==-1) > exit(1); > > int i; > int retval=0; > try{ > /* Why lots of buffers rather than one big buffer. It is my > expectation that this is the way that OpenMPI does it when > it allocates its set of queue pair destinations. */ > > for(i=0;i<BUFFERS;i++){ > buffers[i]=new char[BUFSIZE]; > } > > pthread_t copy_thread; > pthread_create(©_thread,NULL,copy_block,NULL); > > /* Bang on them in a random order */ > for(i=0;i<BUFFERS;i++){ > int cur; > while(buffers[cur=random()%BUFFERS][random()%BUFSIZE]==0) > read(random_fd,buffers[cur],BUFSIZE); > std::cout << 'a'+ child_num; > } > } > catch(std::bad_alloc &e){ > std::cout << "failed allocating " << i << '\t'; > retval=2; > } > > std::cout << getpid() <<'\n'; > exit(retval); >} > >void *copy_block(void *){ > for(int i=0;i<BUFFERS/2;i++){ > int src; > while(buffers[src=random()%BUFFERS][random()%BUFSIZE]==0); > > int dst; > while(buffers[dst=random()%BUFFERS][random()%BUFSIZE]==0) > memcpy(buffers[dst],buffers[src],BUFSIZE); > std::cout << 'A'+ child_num; > } >}
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 435662
: 296546