Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYCTG-00020d-43 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2016 13:25:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYCTF-0003jp-EG for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2016 13:25:57 +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 1bYCTC-0003iH-RG for pgsql-hackers@postgresql.org; Fri, 12 Aug 2016 13:25:55 +0000 Received: from nm18-vm1.bullet.mail.sg3.yahoo.com ([106.10.149.96]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bYCT3-0003sW-Vf for pgsql-hackers@postgresql.org; Fri, 12 Aug 2016 13:25:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s2048; t=1471008338; bh=kwPFO2IOOUeyfS9RZnDoCzEX2uUpuU/gSLSJ1xDstWI=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=kCsT4yUJ0jhZy4JNNS3nwl3sjp/yt5SiPRssFoIF6KfGJt0K3HVWKEGxZTk1B2zzCPjUf390sYc5Q1VnY82BdTx2fS2zOby308az2a1EyOPIj4Wv3eETDzE3DgLPxGlZsvsaIchthPl+W5frE74gsKbGK0IQCuCcX9u9nUeKmHosC6Yj/KJZLJZyv61akcRu4Ejke+jqDmvqKUDfSxcIQVr1oHvBbNCWFazqHfGQwt/tCdJJeLMi53jDKeI4eoLMS/UbVlN75yMGL683ePTmWxMQZD3p1or5RooSeee3mtsm8OBRQP/rrc9UovhLhR7zYFIxzZ7Hhy04/wUqNWfEFw== Received: from [106.10.166.118] by nm18.bullet.mail.sg3.yahoo.com with NNFMP; 12 Aug 2016 13:25:38 -0000 Received: from [106.10.151.171] by tm7.bullet.mail.sg3.yahoo.com with NNFMP; 12 Aug 2016 13:25:38 -0000 Received: from [127.0.0.1] by omp1011.mail.sg3.yahoo.com with NNFMP; 12 Aug 2016 13:25:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 356981.51098.bm@omp1011.mail.sg3.yahoo.com X-YMail-OSG: CIbcgCAVM1kfzOcoPhHPfQ08mh.6EpeNy3q8PJ1djLqWjC9D1aCBhfhOkvFo9G2 4827v.OpViEAEA5nlUUk2KPAH5a8gDkE2xEhWqb_.3.GJc38ybbpzvMHzIIgBnn6fi0p1XA5p859 NLDeRV99kmm77cq7aUVi1cQHWFJ7t_YOImYZsFn7.Iy.mWVYxt46g0AfvTqiE5dVeDxURwB0_Akj QWAYETsq9tBVTS3Bbv4Wq3YJuqyEyGT1fo.VP3Y7MhiKuYR.DezXQU10ky8FBZptMDs2wyJ1CZmL S_DG4G4upd6cP63NyQ0nLMPN54092zMuOkZ4kHfgAq98qZ808VvGWfH3JsrS6faKK87toYFIqtA5 bK6mYrtrBzNmxwvFV9PY8yOxNwVzkaGQOmlOWTB3ggswall0Y4LhYQBZn8euetTiz0tqtmF3weIy uF09XgdzNyNUev9CGx.mTxAApeuzCAubmZ8fcjgIjH.bygROZd7hRY4nVQDkDV1J7DEipWpUitmY SFc31JnXxshIGR6d3Bka8DmsSFg-- Received: from jws10938.mail.sg3.yahoo.com by sendmailws106.mail.sg3.yahoo.com; Fri, 12 Aug 2016 13:23:58 +0000; 1471008238.531 Date: Fri, 12 Aug 2016 13:23:43 +0000 (UTC) From: amul sul Reply-To: amul sul To: PostgreSQL-development Message-ID: <1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com> Subject: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create(). MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12301801_1408597230.1471008223418" References: <1002664500.12301802.1471008223422.JavaMail.yahoo.ref@mail.yahoo.com> Content-Length: 3334 X-Pg-Spam-Score: -2.7 (--) 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 ------=_Part_12301801_1408597230.1471008223418 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi All, When I am calling dsm_create on Linux using the POSIX DSM implementation ca= n succeed, but result in SIGBUS when later try to access the memory. =C2=A0= This happens because of my system does not have enough shm space & =C2=A0cu= rrent allocation in dsm_impl_posix does not allocate disk blocks[1].=C2=A0I= wonder can we use=C2=A0fallocate system call (i.e. Zero-fill the file) to = ensure that=C2=A0all the file space has really been allocated, so that we d= on't=C2=A0later seg fault when accessing the memory mapping. But=C2=A0here = we will endup by=C2=A0loop calling =E2=80=98write=E2=80=99=C2=A0squillions= =C2=A0of times. Thoughts/Suggestions ? Similar post:=C2=A0=C2=A0[1] http://uk.comp.os.linux.narkive.com/Ve44sO4i/s= hared-memory-problem-no-space-at-dev-shm-causes-sigbus=C2=A0 Regards,Amul Sul ------=_Part_12301801_1408597230.1471008223418 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi All,

When I am calling dsm_create on Linux using the POSIX DSM i= mplementation can succeed, but result in SIGBUS when later try to access th= e memory.  This happens because of my system does not have enough shm = space &  current allocation in dsm_impl_posix does not allocate di= sk blocks[1].
 
I wonder can we use fallocate system call (i.e. Zero-fill the f= ile) to ensure that all the file space has really been allocated, so t= hat we don't later seg fault when accessing the memory mapping. But&nb= sp;here we will endup by loop calling =E2=80=98write=E2=80=99 squ= illions of times.

Thoughts/Suggestions ?

S= imilar post: 
 [1] http://uk.comp.os.linux.narkive.com/Ve44sO= 4i/shared-memory-problem-no-space-at-dev-shm-causes-sigbus 

Regards,
Amul Sul
------=_Part_12301801_1408597230.1471008223418--