Re: BUG #18974: Postgresql repeatable crash after pg_upgrade from 15 to 17.5 version in postgresql_fdw queries

Maxim Boguk <maxim.boguk@gmail.com>

From: Maxim Boguk <maxim.boguk@gmail.com>
To: maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-07-02T00:03:00Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Correctly copy the target host identification in PQcancelCreate.

On Wed, Jul 2, 2025 at 1:09 AM PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      18974
> Logged by:          Maxim Boguk
> Email address:      maxim.boguk@gmail.com
> PostgreSQL version: 17.5
> Operating system:   Ubuntu
> Description:
>
> Postgresql repeatable crash after pg_upgrade from 15 to 17.5 version in
> postgresql_fdw timeouted (via query_timeout) queries
> Backtrace data from core file:
> Core was generated by `postgres: 17/main: **.app **_data [local] SELECT
> '.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:314
> warning: 314    ../sysdeps/x86_64/multiarch/strcmp-evex.S: No such file or
> directory
> (gdb) bt
> #0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:314
> #1  0x0000780820fd2df7 in emitHostIdentityInfo (conn=0x5d89b19f6d80,
> host_addr=0x7ffd34c50c70 "10.100.103.4") at
>

(gdb) print ((PGconn *)0x5d89b19f6d80)->connhost[0]
$14 = {type = CHT_HOST_NAME, host = 0x0, hostaddr = 0x5d89b19c53b0
"10.100.103.4", port = 0x5d89b19c5390 "6503", password = 0x0}
As a result displayed_host = conn
<https://doxygen.postgresql.org/streamutil_8c.html#af4516154f33e07be1eadff88fab71465>
->connhost
<https://doxygen.postgresql.org/structpg__conn.html#af613581f3bb3ef9a64acf0346c3cd92b>
[conn
<https://doxygen.postgresql.org/streamutil_8c.html#af4516154f33e07be1eadff88fab71465>
->whichhost
<https://doxygen.postgresql.org/structpg__conn.html#aef258b7f6a1d241b2fad5728aa08a1ef>
].host
<https://doxygen.postgresql.org/structpg__conn__host.html#a112de1e777da00724075fe6f65aaf3be>
=
0x0
and crash in line strcmp(displayed_host, host_addr) != 0

related FDW definition:
FDW options          | ( dbname '****', hostaddr '10.100.103.4', port
'6503')



-- 
Maxim Boguk
Senior Postgresql DBA

Phone UA: +380 99 143 0000
Phone AU: +61  45 218 5678