shm in 2.1.125

Christoph Rohland (hans-christoph.rohland@sap-ag.de)
10 Oct 1998 20:54:42 +0200


Unfortunately the changes for 2.1.125 did extend the maximum possible
SHM segment size from (128M - 1 page) to 128M and make a misconfigured
kernel behave very bad!

since shm_npages in shmid_ds is unsigned short we can at most allocate
65535 pages. This is not noted by shmget which happily gives you a
segment for e.g. 256M = 65536 pages. But the following shmat will see
0 pages for the segment and the application will get nothing (but a
seg-fault ;-). Worse: on deletion the total count for shm pages will
be decreased by also 0. So following allocations fail after a while.

Since shmid_ds is shared with user space we cannot change it easily.

Any ideas?

Cheers
Christoph

-
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/