Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!uvaarpa!mcnc!rti!mcm From: mcm@rti.rti.org (Mike Mitchell) Newsgroups: comp.unix.ultrix Subject: brk() bug Keywords: PTE, TLB, brk() Message-ID: <3761@rtifs1.UUCP> Date: 12 Apr 90 20:15:21 GMT Organization: Research Triangle Institute, RTP, NC Lines: 48 I see that DEC has new versions of ULTRIX to support the new workstations. I am wondering if ULTRIX 3.1C, ULTRIX 3.1D, or a beta-version of ULTRIX 4.0 fixes a bug I reported in August of last year. The problem is with the way the 'brk()' system call works. Specifically, it does not properly free up memory released. This bug was fixed in BSD 4.3-tahoe, and only takes one line of code to correct. It does NOT show up on machines with less than 8 TLB entries, such as MicroVaxes. All of the DECstations/DECsystems are affected. If you are running a version of ULTRIX more recent than 3.1A, please try running the enclosed program. I'd really like to know if DEC has fixed this bug. ------------------------------------------------------------------------------- /* * This program shows off a problem with the kernel's "expand()" routine. */ #include main() { char *old_break, *cp; int i; extern char *sbrk(), *brk(); void segv(); signal(SIGSEGV, segv); i = getpagesize(); old_break = sbrk(0); /* get the current "break" */ (void) brk(old_break + 2*i); /* bump it up 2 pages */ cp = old_break + i + 256; *cp = 1; /* write into a new page */ (void) brk(old_break); /* release the memory */ *cp = 2; /* write into the page again. This */ /* time, you should get a sigsegv */ printf("Your brk routine is broken!\n"); exit(1); } void segv() { printf("Your brk routine works correctly.\n"); exit(0); } -------------------------------------------------------------------------------