[TESTCASE] `Out of memory for cc1'

Mike Galbraith (mikeg@weiden.de)
Fri, 9 Apr 1999 07:59:32 +0200 (CEST)


Hi,

I took a look at what the clisp package is doing which leads up
to the error condition, and find that it's shm. The following
testcase is extracted from 'configure', and causes the symptom
to appear reliably (here:).

To create the problem, run while true; do kaboom; done on one
vt, and then try to do pretty much _anything_ on another.

-Mike

---------------------------shm testcase--------------------------
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

/* try attaching a single segment to multiple addresses */
#define segsize 0x10000
#define attaches 128
#define base_addr 0x01000000
main ()
{ int shmid, i; char* addr; char* result;
if ((shmid = shmget(IPC_PRIVATE,segsize,0400)) < 0) exit(1);
for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
{ if ((result = shmat(shmid,addr,SHM_RDONLY)) == (char*)(-1)) break; }
for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
shmdt(addr);
shmctl(shmid,IPC_RMID,0);
exit(result == (char*)(-1));
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/