NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/38109: Shared memory code can't handle > 4GB of memory



The following reply was made to PR kern/38109; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/38109: Shared memory code can't handle > 4GB of memory
Date: Thu, 3 Apr 2008 03:09:30 +0000

 On Tue, Feb 26, 2008 at 09:40:00PM +0000, cbrand%redback.com@localhost wrote:
  > The shared memory code stores the total number of bytes available
  > for use as shared memory in shminfo.shmmax. This is a uint32_t, so
  > it overflows at 4GB (note that it's initially set to the max number
  > of pages, but this is the multiplied by PAGE_SIZE).
  >
  > Index: sys/kern/sysv_shm.c
  > ===================================================================
  > RCS file: /cvsroot/pkt/sw/netbsd300/usr/src/sys/kern/Attic/sysv_shm.c,v
                                                         ^^^^^
  > [...]
 
 All that stuff got ripped out in -current and replaced with new code
 that doesn't have such silly limits.
 
 FWIW.
 
 I don't know what the prospects are for getting the new code in 3.x;
 but maybe the simple fix will do.
 
  > <       int32_t shmmax;         /* max shared memory segment size (bytes) */
  > ---
  > >       int64_t shmmax;         /* max shared memory segment size (bytes) */
 
 ...it should be size_t (or ssize_t if it really needs to be signed for
 some reason), not either int32_t or int64_t.
 
 (Also, in general, when sending diffs please use diff -u or diff -up.)
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index