Re: BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements
Date: 2023-04-07 08:57:27
Message-ID: CAMbWs48s6Uhv9wngJVtv=7DGEyN9a-SzwBKsfz2hY7yS6z7ZQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Apr 7, 2023 at 4:21 AM PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following script:
> CREATE EXTENSION intarray;
> CREATE TABLE test__int(a int[]);
> CREATE INDEX test_idx on test__int using gist (a gist__int_ops);
> INSERT INTO test__int SELECT array(SELECT x FROM generate_series(1, 1001)
> x)
> FROM generate_series(1, 10);
>
> causes a server crash:
> CREATE INDEX
> NOTICE: input array is too big (199 maximum allowed, 1001 current), use
> gist__intbig_ops opclass instead
> NOTICE: input array is too big (199 maximum allowed, 1001 current), use
> gist__intbig_ops opclass instead
> NOTICE: input array is too big (199 maximum allowed, 1001 current), use
> gist__intbig_ops opclass instead

In g_int_compress,

if (ARRNELEMS(r) >= 2 * num_ranges)
elog(NOTICE, "input array is too big (%d maximum allowed, %d current),
use gist__intbig_ops opclass instead",
2 * num_ranges - 1, ARRNELEMS(r));

Wondering why elog with NOTICE rather than Error here.

Thanks
Richard

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Etsuro Fujita 2023-04-07 09:16:03 Re: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)
Previous Message PG Bug reporting form 2023-04-06 18:42:38 BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)