pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: bernddorn@gmail.com
Subject: BUG #17227: segmentation fault with jsonb_to_recordset
Date: Wed, 13 Oct 2021 09:16:08 +0000
Message-ID: <17227-5a28ed1512189fa4@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17227
Logged by:          Bernd Dorn
Email address:      bernddorn@gmail.com
PostgreSQL version: 14.0
Operating system:   docker postgres:14 on osx
Description:        

to reproduce :

```
docker run --name pg -p 5432:5432 --rm -e POSTGRES_PASSWORD=pw postgres:14
docker exec -ti pg psql --user postgres
```
run this query:
```
select *
from (
         select jsonb_path_query_array(module -> 'lectures', '$[*]') as
lecture
         from unnest(
             array[$${
               "lectures": [
                 {
                   "id": "1"
                 }
               ]
             }$$::jsonb]) as unnested_modules(module)
     ) as l,
     jsonb_to_recordset(l.lecture) as (id text)
limit 1;
```

output in logs:

```
2021-10-13 09:07:58.073 UTC [1] LOG:  server process (PID 83) was terminated
by signal 11: Segmentation fault
2021-10-13 09:07:58.073 UTC [1] DETAIL:  Failed process was running: select
*
	from (
	         select jsonb_path_query_array(module -> 'lectures', '$[*]') as
lecture
	         from unnest(
	             array[$${
	               "lectures": [
	                 {
	                   "id": "1"
	                 }
	               ]
	             }$$::jsonb]) as unnested_modules(module)
	     ) as l,
	     jsonb_to_recordset(l.lecture) as (id text)
	limit 1;
2021-10-13 09:07:58.073 UTC [1] LOG:  terminating any other active server
processes
2021-10-13 09:07:58.074 UTC [84] FATAL:  the database system is in recovery
mode
2021-10-13 09:07:58.076 UTC [1] LOG:  all server processes terminated;
reinitializing
2021-10-13 09:07:58.089 UTC [85] LOG:  database system was interrupted; last
known up at 2021-10-13 09:07:34 UTC
2021-10-13 09:07:58.180 UTC [85] LOG:  database system was not properly shut
down; automatic recovery in progress
2021-10-13 09:07:58.182 UTC [85] LOG:  redo starts at 0/16FAB48
2021-10-13 09:07:58.182 UTC [85] LOG:  invalid record length at 0/16FAB80:
wanted 24, got 0
2021-10-13 09:07:58.182 UTC [85] LOG:  redo done at 0/16FAB48 system usage:
CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2021-10-13 09:07:58.192 UTC [1] LOG:  database system is ready to accept
connections
```



view thread (7+ messages)  latest in thread

Message-ID: <17227-5a28ed1512189fa4@postgresql.org>
Permalink:  ../17227-5a28ed1512189fa4@postgresql.org/
Also on:    postgresql.org/message-id/17227-5a28ed1512189fa4@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, bernddorn@gmail.com
  Subject: Re: BUG #17227: segmentation fault with jsonb_to_recordset
  In-Reply-To: <17227-5a28ed1512189fa4@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox