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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: amul sul <sul_amul(at)yahoo(dot)co(dot)in>
Cc: 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 14:08:01
Message-ID: 25838.1471010881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

amul sul <sul_amul(at)yahoo(dot)co(dot)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 usefallocate system call (i.e. Zero-fill the file) to ensure thatall the file space has really been allocated, so that we don'tlater seg fault when accessing the memory mapping. Buthere we will endup byloop calling writesquillionsof 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-12 14:55:07 Re: Add hint for function named "is"
Previous Message Greg Stark 2016-08-12 13:40:46 Re: Add hint for function named "is"