Re: BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements
Date
Msg-id CAMbWs48s6Uhv9wngJVtv=7DGEyN9a-SzwBKsfz2hY7yS6z7ZQw@mail.gmail.com
Whole thread Raw
In response to BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17888: Incorrect memory access in gist__int_ops for an input array with many elements
List pgsql-bugs

On Fri, Apr 7, 2023 at 4:21 AM PG Bug reporting form <noreply@postgresql.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

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)
Next
From: Etsuro Fujita
Date:
Subject: Re: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)