Hi, I have 2 AlphaServers with OpenBSD: - OpenBSD 6.6 on Alphaserver DS10 - OpenBSD 7.1 on Alphaserver DS25 with additional configuration on both machines: $ cat /etc/sysctl.conf kern.shminfo.shmmax=1073741824
A simple test application is compiled natively on each machine with gcc version 4.2.1 20070719. The application calls shmget() and immediately after that shmat(). For the test, the application is started from the command line many times, each time having no other ipc instances. $ ipcs Message Queues: T ID KEY MODE OWNER GROUP Shared Memory: T ID KEY MODE OWNER GROUP Semaphores: T ID KEY MODE OWNER GROUP ==> shmat() fails sporadically on both machines from time to time: Succeeds: ========= 40265 probe CALL kbind(0x1fffc8ba8,24,0x343c90695b0bb6da) 40265 probe RET kbind 0 40265 probe CALL shmget(0,0x11e1a300,IPC_CREAT|IPC_EXCL|SEM_R|SEM_A|(SEM_R>>3)|(SEM_A>>3)) 40265 probe RET shmget 786432/0xc0000 40265 probe CALL kbind(0x1fffc8ba8,24,0x343c90695b0bb6da) 40265 probe RET kbind 0 40265 probe CALL shmat(786432,0x40000000,0x2000<SHM_RND>) 40265 probe RET shmat 1073741824/0x40000000 Fails: ====== 19536 probe CALL kbind(0x1fffcbfc0,24,0x341a99ad9dcf9f30) 19536 probe RET kbind 0 19536 probe CALL shmget(0,0x11e1a300,IPC_CREAT|IPC_EXCL|SEM_R|SEM_A|(SEM_R>>3)|(SEM_A>>3)) 19536 probe RET shmget 917504/0xe0000 19536 probe CALL kbind(0x1fffcbfc0,24,0x341a99ad9dcf9f30) 19536 probe RET kbind 0 19536 probe CALL shmat(917504,0x40000000,0x2000<SHM_RND>) 19536 probe RET shmat -1 errno 12 Cannot allocate memory