#263 closed defect (fixed)
After a very high number of fork/system/popen calls
Reported by: | dcs | Owned by: | bird |
---|---|---|---|
Priority: | normal | Milestone: | libc-0.6.6 |
Component: | libc-backend | Version: | |
Severity: | normal | Keywords: | |
Cc: |
Description
On my sever with a "cron" type process running fork/system/popens very frequently. The end result is that after so long any program that uses LIBC065 will fail to start with a "LIBC Error: Couldn't register process in shared memory!" Anything that is already started or does not use LIBC065 just sails along merrily. Although the ones that do use it may hang when you try and shutdown.
On my laptop I can reproduce the first type by using "ps" but if I change it to a "hello world" program I get the "nothing will shut down" problem. I think the problem has been around for a long time as I have *never* had uptime on the server of more than three weeks - I think LIBC065 has just made it worse - I never saw that libc error message before 65 came along.
The following program shows the problem:
#include <os2.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <errno.h>
int main(int argc, char argv) {
long count;
FILE *ptr;
for(count = 1;; count++) {
ptr = popen(ps_string, "r");
if ( ptr == NULL ) {
int local_errno = errno; printf("\npopen(%s read) failed: %s\n", ps_string, strerror(local_errno)); exit(0);
}
fgets(psline, 80, ptr); /* read header line */
while( fgets(temp, 80, ptr) != NULL ); /* read away rest of popen pipe */ pclose(ptr); printf("\r%ld %s", count, psline);
}
}
and
#include <os2.h> #include <string.h> #include <stdio.h> #include <stdlib.h>
int main(int argc, char argv) {
printf("Hello World");
}
It usually blows around 60,000. Suspect 65535 problem?
I complied the above with EMX and got bored with it at 70,000+
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 11 years ago
Milestone: | → libc-0.6.6 |
---|
Looks like a leak in the shared program manager heap (sharedpm.c).
comment:3 by , 11 years ago
Component: | baselayout → libc-backend |
---|---|
Priority: | highest → normal |
Severity: | blocker → normal |
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Could this be related to #217?