From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 7 20:00:07 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB1510656BC for ; Wed, 7 Jan 2009 20:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E8DA48FC2F for ; Wed, 7 Jan 2009 20:00:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n07K060T071775 for ; Wed, 7 Jan 2009 20:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n07K06tm071774; Wed, 7 Jan 2009 20:00:06 GMT (envelope-from gnats) Resent-Date: Wed, 7 Jan 2009 20:00:06 GMT Resent-Message-Id: <200901072000.n07K06tm071774@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kirk Strauser Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9D9E1065675 for ; Wed, 7 Jan 2009 19:51:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id D88698FC20 for ; Wed, 7 Jan 2009 19:51:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n07Jpjjj050991 for ; Wed, 7 Jan 2009 19:51:45 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n07JpjXH050990; Wed, 7 Jan 2009 19:51:45 GMT (envelope-from nobody) Message-Id: <200901071951.n07JpjXH050990@www.freebsd.org> Date: Wed, 7 Jan 2009 19:51:45 GMT From: Kirk Strauser To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/130274: Can't shmget() more than 2GB of memory, regardless of kern.ipc.shm{max, all} X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2009 20:00:07 -0000 >Number: 130274 >Category: kern >Synopsis: Can't shmget() more than 2GB of memory, regardless of kern.ipc.shm{max,all} >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 07 20:00:06 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Kirk Strauser >Release: 7.1-RELEASE >Organization: The Strauser Group >Environment: FreeBSD db1.daycos.com 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Fri Jan 2 22:14:00 CST 2009 root@db1.daycos.com:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I cannot use shmget() to allocate 2GB or more of shared memory, regardless of the settings of kern.ipc.shmmax and kern.ipc.shmall. Right now, I have: $ sysctl kern.ipc.shmmax kern.ipc.shmmax: 8589934592 $ sysctl kern.ipc.shmall kern.ipc.shmall: 2097152 # 8GB / 4096 Here's a minimal test program I wrote: ######################## #include #include int main() { size_t size = 2*1024*1024*1024l - 4096; int segid; printf("Requested: %zd\n", size); segid = shmget(234, size, IPC_CREAT); if(segid == -1) { perror("Died"); return; } printf("SHM ID : %zd\n", segid); } ######################## If I define "size" to be no larger than 2GB-4KB, then the program finishes successfully. Otherwise, it fails with [ENOSPC]. >How-To-Repeat: Try to allocate 2GB or more of shared memory. >Fix: >Release-Note: >Audit-Trail: >Unformatted: