Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: "sul_amul(at)yahoo(dot)co(dot)in" <sul_amul(at)yahoo(dot)co(dot)in>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().
Date: 2016-08-12 17:05:22
Message-ID: CAGTBQpZoEX7bHLMFDVKHAnf7VKLmCCEb=C=Zv0omnc60r4uihg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 12, 2016 at 1:55 PM, amul sul <sul_amul(at)yahoo(dot)co(dot)in> wrote:
> 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?

Overcommit can be caught at dsm_create time with an mlock call (note,
that MAP_LOCKED isn't the same). Even a transient lock (mlock +
munlock) could prevent sigbus due to overcommit.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karan Sikka 2016-08-12 17:12:10 Re: TODO item: Implement Boyer-Moore searching in LIKE queries
Previous Message Tom Lane 2016-08-12 16:57:37 Re: Add hint for function named "is"