BUG #17926: Segfault in SELECT

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: erik(at)nib4(dot)nl
Subject: BUG #17926: Segfault in SELECT
Date: 2023-05-08 20:12:41
Message-ID: 17926-2967cc7019697fbe@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17926
Logged by: Erik Oomen
Email address: erik(at)nib4(dot)nl
PostgreSQL version: 15.2
Operating system: Debian11 bullseye arm64
Description:

We are facing an issue where a SELECT can cause a segfault, unfortunately
the backtrace is not useful:
Reading symbols from /lib/aarch64-linux-gnu/libffi.so.7...
Reading symbols from
/root/.cache/debuginfod_client/b07109d62d007af8c6bffe3d76561e03711a1a6c/debuginfo...
0x0000ffff88d1311c in __GI_epoll_pwait (epfd=4, events=0xaaab109dd330,
maxevents=1, timeout=timeout(at)entry=-1, set=set(at)entry=0x0) at
../sysdeps/unix/sysv/linux/epoll_pwait.c:42
Download failed: Invalid argument. Continuing without source file
./misc/../sysdeps/unix/sysv/linux/epoll_pwait.c.
42 ../sysdeps/unix/sysv/linux/epoll_pwait.c: No such file or directory.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00010000017fedec in ?? ()
(gdb) bt
#0 0x00010000017fedec in ?? ()
#1 0x0000ffff017febd0 in ?? ()
#2 0x0000aaab10af7fa8 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The query uses a 3 partitions of a table where all fields have an brin
index.
This query will segfault:
SELECT count(*)
FROM dw
WHERE (dw.ts >= '2022-09-01' AND dw.ts <= '2022-10-30')
AND dw.source='type3' AND dw.customer='123.456';

The query should return 0 because the customer does not exist.
Removing the dw.customer or dw.source constraint will make the segfault not
occur.
Also using 'set enable_bitmapscan to off' will not trigger the segfault.

Details:
PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on aarch64-unknown-linux-gnu,
compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Masahiko Sawada 2023-05-09 01:33:08 Re: Logical Replica ReorderBuffer Size Accounting Issues
Previous Message Tom Lane 2023-05-08 19:29:06 Re: BUG #17925: Incorrect select query result