|
From: John R. <jr...@bi...> - 2012-08-14 16:45:41
|
The code was mangled by posting in HTML. Instead, use plain text (or an attachment, if the mailing list allows them.) I [attempt to] attach the code I used: -rw-rw-r--. 1 jreiser jreiser 3125 Aug 14 09:30 shmtest.c On my system, /usr/include/linux/shm.h says: ----- #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ #define SHMMIN 1 /* min shared seg size (bytes) */ #define SHMMNI 4096 /* max num of segs system wide */ #define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) #define SHMSEG SHMMNI /* max shared segs per process */ ----- In particular, SHMMAX is only 32MiB, so several of the attempted shared segments are too big. My current actual parameters in $ cat /proc/sys/kernel/shmall $ cat /proc/sys/kernel/shmmax $ cat /proc/sys/kernel/shmmni agree with the defaults that are in shm.h. My test program works for me under valgrind-3.8.0 on Fedora 17 x86_64 in 64-bit mode. Linux host.domain 3.5.0-2.fc17.x86_64 #1 SMP Mon Jul 30 14:48:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) I [attempt to] attach the output that I get: -rw-rw-r--. 1 jreiser jreiser 9321 Aug 14 09:31 shmtest.out To see the system calls that valgrind sees: valgrind --trace-syscalls=yes ... Of course you can run that under strace, too, in order to verify that valgrind actually does what it says it is doing: strace valgrind --trace-syscalls=yes ... but it is tedious to read the output. -- |