Re: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query
Adam Scott <adam.c.scott@gmail.com>
From: Adam Scott <adam.c.scott@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>,
pgsql-bugs@lists.postgresql.org
Date: 2019-11-19T02:22:11Z
Lists: pgsql-bugs
Great! Thank you Michael and Tomas!
Maybe a clue to the issue, why does a numrange need to be detoasted since
that is for large strings?
Let me know how I can further help.
Cheers,
Adam
On Mon, Nov 18, 2019 at 5:48 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Mon, Nov 18, 2019 at 03:59:14PM -0800, Adam Scott wrote:
> > It was bugging out with an empty table but it seems intermittent. A
> > successful query followed by the one above will not fail sometimes; hence
> > the need for a from-scratch startup instance of postgres.
>
> Okay, that has proved to help a lot. I have restored the dump, and
> after an analyze on natica_hdu_test I can see the failure
> immediately.
>
> I have also extracted a small test case able to reproduce the failure.
> That's actually pretty close to the scenarios I was playing with
> upthread, still I missed it:
> CREATE TABLE rangetab (a numrange);
> INSERT INTO rangetab
> SELECT ('['|| (45.0 - a::numeric/10000000) || ',' ||
> (45.1 + a::numeric/10000000) || ')')::numrange
> FROM generate_series(1,1000) as a;
> ANALYZE rangetab;
> SELECT a FROM rangetab
> WHERE a <@ '[89.9999998611111,90.0000001388889)';
>
> I can easily reproduce the failure on HEAD, REL_12_STABLE and
> REL_11_STABLE. On 10, I could not. But now that we have a test case
> that's only a matter of time.
> --
> Michael
>
Commits
-
Fix edge-case crashes and misestimation in range containment selectivity.
- 8c8b456b5116 10.12 landed
- 784c58da1957 9.5.21 landed
- 70c17a81278c 12.2 landed
- 6bd567b65858 9.4.26 landed
- 5832be6ca4d7 11.7 landed
- 2dd10477cbfc 9.6.17 landed
- 652686a334b4 13.0 landed
-
Use stdbool.h if suitable
- 9a95a77d9d5d 11.0 cited
-
Redesign get_attstatsslot()/free_attstatsslot() for more safety and speed.
- 9aab83fc5039 10.0 cited