From: amul sul <sul_amul@yahoo.co.in>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().
Date: Fri, 12 Aug 2016 16:55:06 +0000 (UTC)
Message-ID: <1367880874.12379258.1471020906502.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <25838.1471010881@sss.pgh.pa.us>
References: <1002664500.12301802.1471008223422.JavaMail.yahoo.ref@mail.yahoo.com>
<1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com>
<25838.1471010881@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
No segfault during dsm_create, mmap returns the memory address which is inaccessible.
Let me see how can I disable kernel overcommit behaviour, but IMHO, we should prevent ourselves from crashing, shouldn't we?
Regards, Amul---------------------------------------------------------------------------------------------------- Sent from a mobile device. Please excuse brevity and tpyos.
On Fri, 12 Aug, 2016 at 7:38 pm, Tom Lane<tgl@sss.pgh.pa.us> wrote: amul sul <sul_amul@yahoo.co.in> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sul_amul@yahoo.co.in, tgl@sss.pgh.pa.us
Subject: Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().
In-Reply-To: <1367880874.12379258.1471020906502.JavaMail.yahoo@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox