Re: ERROR: too many dynamic shared memory segments

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Jakub Glapa <jakub(dot)glapa(at)gmail(dot)com>, Forums postgresql <pgsql-general(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: too many dynamic shared memory segments
Date: 2017-11-28 07:32:56
Message-ID: CAFiTN-uhcNiaQK9aS0_REr=7YDwgDUU11uWE4mG7t_Rq7Y-GkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Nov 28, 2017 at 4:18 AM, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com
> wrote:

> On Tue, Nov 28, 2017 at 10:05 AM, Jakub Glapa <jakub(dot)glapa(at)gmail(dot)com>
> wrote:
> > As for the crash. I dug up the initial log and it looks like a
> segmentation
> > fault...
> >
> > 2017-11-23 07:26:53 CET:192.168.10.83(35238):user(at)db:[30003]: ERROR:
> too
> > many dynamic shared memory segments
>
> I think there are two failure modes: one of your sessions showed the
> "too many ..." error (that's good, ran out of slots and said so and
> our error machinery worked as it should), and another crashed with a
> segfault, because it tried to use a NULL "area" pointer (bad). I
> think this is a degenerate case where we completely failed to launch
> parallel query, but we ran the parallel query plan anyway and this
> code thinks that the DSA is available. Oops.
>

I think BitmapHeapScan check whether dsa is valid or not if DSA is not
valid then it should assume it's non-parallel plan.

Attached patch should fix the issue.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
bug_fix_in_pbhs_when_dsa_not_initialized.patch application/octet-stream 679 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bjorn T Johansen 2017-11-28 08:18:07 jsonb and where clause?
Previous Message stevenchang1213 2017-11-28 01:29:16 Re: Table and Index bloating

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2017-11-28 07:38:52 Re: [HACKERS] Transactions involving multiple postgres foreign servers
Previous Message Amit Kapila 2017-11-28 07:23:41 Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com