PG 17.6 (supabase/postgres 17.6.1.111) backend SIGSEGV under mixed concurrent load executing a PostgREST jsonb RPC wrapper
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- docker, postgresql
- Ambito
- databases
Direzione di ricerca
Inizia riproducendo il carico di lavoro misto e concorrente con Supabase CLI 2.101.0 e l’immagine supabase/postgres:17.6.1.111, quindi ispeziona docker logs per il signal 11 ripetuto e l’istruzione fallita del wrapper PostgREST che coinvolge json_to_record, json_agg e LATERAL. Il lavoro è completato quando sono stati ottenuti una riproduzione pubblica minima e l’identificazione di una causa di PostgreSQL o del binario pacchettizzato che, con questo carico di lavoro, non produca più segfault del backend.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Under a mixed concurrent workload against the local stack, a Postgres
backend repeatedly dies with signal 11 (Segmentation fault) and the
postmaster enters crash recovery (~8-10 s). Typically 3 crashes per test
run, reproducible across fresh stacks. The crashing statement is ALWAYS
the same: the PostgREST-generated wrapper for one of our RPCs
(jsonb-heavy: json_to_record + json_agg + LATERAL). Five
single-variable A/B experiments (each lever verified active on an
authenticator session before measuring) all crash identically, which
points at the packaged binary rather than configuration or application
code.
To Reproduce
We could not reduce it to a minimal public repro yet — the crash needs
the full mixed workload (private test suite); concurrent calls to the
RPC alone, or combined with concurrent signups, do NOT crash. Workload
shape that reproduces it reliably (3 crashes/run):
supabase start(CLI 2.101.0) +supabase db reseton a schema with
an AFTER-INSERT trigger on signup that clones ~702 rows per new user.- Run a Vitest suite (sequential files) mixing: bursts of
auth.admin.createUser(~20), SECURITY DEFINER journal-entry RPCs,
and repeated calls to a jsonb-taking RPC (upsert_form_draft) via
PostgREST with user JWTs. - Watch
docker logs supabase_db:signal 11followed by "all server
processes terminated; reinitializing" appears ~3 times per run,
always with the same failed statement (below).
A concurrent-load hammer script for the RPC is available on request.
Expected behavior
No backend segfault under concurrent load; worst case a normal SQL
error, never signal 11 + cluster-wide crash recovery.
Screenshots
Log excerpt (identical across occurrences):
LOG: server process (PID ...) was terminated by signal 11: Segmentation fault
DETAIL: Failed process was running: WITH pgrst_source AS (
SELECT pgrst_call.* FROM (SELECT $1 AS json_data) pgrst_payload,
LATERAL (SELECT ... FROM json_to_record(pgrst_payload.json_data)
AS _(... "p_payload" jsonb ...) LIMIT 1) pgrst_body,
LATERAL "public"."upsert_form_draft"(...) pgrst_call )
SELECT ..., coalesce(json_agg(_postgrest_t)->0, 'null') AS body, ...
LOG: all server processes terminated; reinitializing
FATAL: the database system is in recovery mode
System information
- OS: Windows 11 + Docker Desktop (WSL2 VM: 12 CPU / 7.56 GiB)
- Browser: N/A (server-side; Vitest + PostgREST)
- Version of supabase-js: 2.105.1
- Version of Node.js: v24.15.0
- Supabase CLI: 2.101.0 · image
supabase/postgres:17.6.1.111→
PostgreSQL 17.6, compiled by gcc 15.2.0 · PostgREST v14.5 ·
GoTrue v2.189.0 - Settings: shared_buffers 128MB · work_mem 4MB · jit=on (llvmjit) ·
max_parallel_workers_per_gather=2
Additional context
Ruled out by single-variable A/B (each lever verified active; all
crash identically — 3 signal 11 per run):
| Lever | How applied |
|---|---|
| jit = off | ALTER DATABASE/SYSTEM + PostgREST pool reconnect (verified PostgREST's preamble does not reset jit) |
| max_parallel_workers_per_gather = 0 | ALTER DATABASE + db restart |
| pg_stat_statements removed from shared_preload_libraries | direct auto.conf edit |
| plan_filter removed from shared_preload_libraries | direct auto.conf edit |
| CLI 2.101 → 2.106 | image is byte-identical (17.6.1.111), so the bump cannot affect it |
Not resource starvation: 33/100 connections, /dev/shm at 2%, ~5.2 GB
free in the VM. The trigger-cloned table has no exotic column types
(uuid/varchar/text/bool/timestamptz). Logflare logical replication
(publication logflare_pub) is active and appears interleaved with
the crashes in the log. Working hypothesis: a miscompilation in the
jsonb expression path given the gcc 15.2.0 build of PG 17.6.
- Lingua principale
- Nix
- Stelle
- 1.8k
- Fork
- 268
- Merge medio
- 3g 22h
- PR unite (30g)
- 44
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di supabase/postgres
-
CREATE EXTENSION pgmq fails in Postgres 17.6.1.016+ due to function overload handling bug in after-create scriptForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
supabase/postgres#1867 · 14 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
supabase/postgres#1586 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
supabase_auth_admin can CREATE rolesForse già presa @jaysomani l’ha presa 50 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
supabase/postgres#1518 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di supabase/postgres
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Arekkazu/sgpmp-backend#549 ·
I maintainer di solito rispondono entro 1 giorno
-
priority: medium tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
LeeAdcock/robocodeJs.com#411 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
pedrorchagas/blog-api#18 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 2 giorni