Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYD84-0003ij-Lp for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2016 14:08:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYD84-00063e-5a for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2016 14:08:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bYD82-00060o-M3 for pgsql-hackers@postgresql.org; Fri, 12 Aug 2016 14:08:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bYD7z-0004bg-Je for pgsql-hackers@postgresql.org; Fri, 12 Aug 2016 14:08:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7CE81qv025839; Fri, 12 Aug 2016 10:08:02 -0400 From: Tom Lane To: amul sul cc: PostgreSQL-development Subject: Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create(). In-reply-to: <1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com> References: <1002664500.12301802.1471008223422.JavaMail.yahoo.ref@mail.yahoo.com> <1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com> Comments: In-reply-to amul sul message dated "Fri, 12 Aug 2016 13:23:43 -0000" Date: Fri, 12 Aug 2016 10:08:01 -0400 Message-ID: <25838.1471010881@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org amul sul writes: > When I am calling dsm_create on Linux using the POSIX DSM implementation can succeed, but result in SIGBUS when later try to access the memory.  This happens because of my system does not have enough shm space &  current allocation in dsm_impl_posix does not allocate disk blocks[1]. I wonder can we use fallocate system call (i.e. Zero-fill the file) to ensure that all the file space has really been allocated, so that we don't later seg fault when accessing the memory mapping. But here we will endup by loop calling ‘write’ squillions of times. Wouldn't that just result in a segfault during dsm_create? I think probably what you are describing here is kernel misbehavior akin to memory overcommit. Maybe it *is* memory overcommit and can be turned off the same way. If not, you have material for a kernel bug fix/enhancement request. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers