Re: Segmentation fault - PostgreSQL 17.0 - Mailing list pgsql-bugs

From Tomas Vondra
Subject Re: Segmentation fault - PostgreSQL 17.0
Date
Msg-id b0440895-3f84-4d97-812e-a966a3c25396@vondra.me
Whole thread Raw
In response to Re: Segmentation fault - PostgreSQL 17.0  (Ľuboslav Špilák <lspilak@microstep-hdo.sk>)
Responses Re: Segmentation fault - PostgreSQL 17.0
List pgsql-bugs
On 11/9/24 14:02, Ľuboslav Špilák wrote:
> Ahoj/Hello.
> 
> On migrated db.
> In postgres or public schema (im not sure now) I created the table with
> one column int8 - cas (unixtime)
> Then I create index brin on that column (by cas/unixtime).
> Insert only one row.
> Then I Vacuumed table.
> 

So is this a tiny single-row table? Did you create it on PG17, or before
running pg_upgrade?

> I want to check brin index with
> Funkcions:
> 
> |brin_metapage_info .. ok|
> |brin_revmap_data .. ok|
> |brin_page_items .. sigsegv|
> 
> This is done repeatedly on my migrated db.
> 
> On Monday I could try create new cluster / empty database and try the
> same again.
> 
> I must google it to know how:
> "attach GDB to a backend before running the query.
> Alternatively, you can enable core files, and generate the backtrace "
> 

There are wiki pages [1] and [2] with instructions how to do this. But
in short, connect to the DB, get PID using

    SELECT pg_backend_pid();

attach gdb to that backend

    gdb -p $PID

Hit 'c' to continue running the program, and run the crashing query in
the client. The gdb session will interrupt on the segfault, and you'll
be able to get backtrace by 'bt'.

> In Your pg17 db this funkction works correctly?
> 

It works for me, yes. this is what I tried:

create table t (a bigint);
insert into t values (1);
create index on t using brin (a);

select * from brin_metapage_info(get_raw_page('t_a_idx', 0));
   magic    | version | pagesperrange | lastrevmappage
------------+---------+---------------+----------------
 0xA8109CFA |       1 |           128 |              1
(1 row)

select * from brin_revmap_data(get_raw_page('t_a_idx', 1));
 pages
-------
 (2,1)
 (0,0)
 (0,0)
...

select * from brin_page_items(get_raw_page('t_a_idx', 2), 't_a_idx');
 itemoffset | blknum | attnum | allnulls | hasnulls | placeholder |
empty |  value
------------+--------+--------+----------+----------+-------------+-------+----------
          1 |      0 |      1 | f        | f        | f           | f
 | {1 .. 1}
(1 row)

But this is just a very simple test.


regards

-- 
Tomas Vondra




pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Segmentation fault - PostgreSQL 17.0
Next
From: Ľuboslav Špilák
Date:
Subject: Re: Segmentation fault - PostgreSQL 17.0