Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6NiC-004FHb-0H for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Mar 2026 07:04:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6Ni8-00DeRQ-1E for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Mar 2026 07:03:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6Ni8-00DeRI-0B for pgsql-bugs@lists.postgresql.org; Sat, 28 Mar 2026 07:03:56 +0000 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6Ni5-00000001cMd-3Cnn for pgsql-bugs@lists.postgresql.org; Sat, 28 Mar 2026 07:03:55 +0000 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-2b8095668ebso59156eec.2 for ; Sat, 28 Mar 2026 00:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774681432; cv=none; d=google.com; s=arc-20240605; b=QiKuz+AukCo5vP+twoX/J0CXL13LftmBRU328cRAMRksbDQqUSHMCJFC35dDn8gD/R lTGeBGFMQGyKWdkZy5rELpn76Gcgn+PBcy+2Z0h8Dg8HlSIPo7Q7mCkfJHX6RbSsRI3c hKFs3/eoPyZ+C6Km+ZI4N7/OkgdrYaaBfa2o3f3ptxhyuUvmunSpuBotStKTmLLbgist /0xKbQs6lps42CzjvhTZYWNx7+NE8vWTIog5zt4ok3FFgcu2aVc2nLNz1mxxn0ZWj5Bz tKZi4BtH9FI2hrJ7T0yNLF6CLqP4bPE1xICMHyUasOcLF5WALbQyRLX+BUc3IFkPtUCS VQIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wodtUlYKKmZO7XSHUcTUE1q4OBymi/pA4TF6lBX9CNw=; fh=dRyfScrQBgxGhAG9XRxlFZL+TTJNrXnuXEKcgzfji8Y=; b=QT0psc+vb5qbDDTptvHhe3E379CtPNBOMhvPf2rQo4pPMBGpPZzRvtNyxFU7rTpONR Km5RC/oSVlWhgcwa88VTLB7cU45xiE6seyfsdoWe5z4E9TN9pkQw24dfGZnnwDZNTHp9 KHPL58RpTuSEn9tiMZcSfCHc0bSNIl6vKKZks9U24j6Z1Az31ld1tong7spnPhooeAN4 pvsqTQQ8KNdPldZrrWrBIGxejVdSixxZ1kh7Q23reX5XOnbyKcR8tYpMxyZxY7WjDdW6 IIrIZA4bITQZKUiNMLTRqC5LT+eJvjxln2Ou+76Dg74GV+5SyQM0kObVr35WPryCulCY SISQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774681432; x=1775286232; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wodtUlYKKmZO7XSHUcTUE1q4OBymi/pA4TF6lBX9CNw=; b=UFYY3YEMSplm6pMt1/Okyu60OvD/BftqD97hPWoJXs4boCUApAGeqBdl5RaNV1NRoK 9vt3wwoEf7YjcktnJK30KSEbaECfZZzSjuB90dLle8mzsSasuFb3OKD4tEhmvgfCfbsq LdNiUbbKfoiMaM6zsRkW1ynPm57ScJJjNpJ3g2yp2nnfmNC584fyGcZ897NekSUUcEBv VrVIcoGDtI1MkgD3oRrhdR0xqE/nCAYXs5cNxoAqMIfiEgP7VdnoX5f0Udq9aLp9WHk7 FWcMwxLVJlA3rRy8FZZ7jP9J2oR0aXtCj3p6QeGMGlZo2L4vEoB4qwuVC2uSB3SCfQE7 w1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774681432; x=1775286232; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wodtUlYKKmZO7XSHUcTUE1q4OBymi/pA4TF6lBX9CNw=; b=FZh97q4oojXwgbayTQS1wCCIS6xP8imltBPGIiA9u5QgS713u/3TihSm+8Cb36ryfx LQcjMldbkQZd8UbFvnU5sG25664KwJX+jQw2gzZ9tcYhhLpXw05PKPLRnEuBAbwj+Vip plcYOHo+eOrOppzcP1BI0iD/ioIq8brbl21GD6ntqQdwFAjOGwWkbjISNXKBOq8CTVPn F5r52wCCGvZ+pypVvGjCNG/ykQYBiOG0TDc0DRvhPGr2I7EE90LZP0jNN6OxKx1PYGy2 2Xcibuqls/GyPOHb//IzxoeQOsMdDNU9q8zQNC/zGZjP1mhml71WC7FmRkovQl9GZE5j vY6g== X-Forwarded-Encrypted: i=1; AJvYcCWZvyVoJnq/vJgW/H06lbmLcMx1hrYxnZC0z0nCqikQLXUSPit4qVuLaJo2FzwsKzBF3+yBiRph8mtz@lists.postgresql.org X-Gm-Message-State: AOJu0Yxei6n8mEUWKkpk9ym8Ys10DKWXQIPpae/wNHqgXfTn/e+uqNoF v5w8Mhfdwa+ZvVPp7j89vcCjHS8ow6aTU1+ULefkRkpnkfjF/3HiJYgdofAzHMZpr06N5BtjsPf USQ30Nu4oGGtG8F7tjM7PraLD1yVThSvwa0Wf X-Gm-Gg: ATEYQzwVT7PiCHjeR0AMk3VaZtIF3zrRSRWL/ZUZ77bUxxQLgKBWFJN+dH8fVO+ktuc 6B3XjBWJRQVIINfhRaWyrzgumWxiMP+joHiM/+0t0ditSuK3IqWnAaSDlJ1D5ddejIfkRfW4zPn j4kAPLdw+pmyFcpviIN09TfFFrdO6ns267wIoEu5e/3jlzzdDiMdQf+nVg/t27uqX/2/4gjOMHv Yzsq5z86WyA7WZJ63mm9S3C4hzb7j+oFDksTnMKO2kKKNLfnZek5XzEz+v3gyjvNC9DLigwAVnE 0aw8m1kuqbcR+sJK8sA7/QhAbxSUvHlWTGsbGzQTPcf02xserSfL7Yhn81rbDu0u X-Received: by 2002:a05:7300:5707:b0:2be:687:5dbc with SMTP id 5a478bee46e88-2c185ea8b22mr1381561eec.6.1774681431576; Sat, 28 Mar 2026 00:03:51 -0700 (PDT) MIME-Version: 1.0 References: <19416-967b71bb54d8fe9b@postgresql.org> In-Reply-To: <19416-967b71bb54d8fe9b@postgresql.org> From: Thomas Munro Date: Sat, 28 Mar 2026 20:03:14 +1300 X-Gm-Features: AQROBzAN0P7qJwoyJoli1XAat1u0itHQ0JrfQokiw1BYT70rMeOzimchpmLCKEI Message-ID: Subject: Re: BUG #19416: Backend SIGSEGV in ExecShutdownHashJoin/ExecHashTableDetach/dsa_free To: ch+pg@zeha.at, pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 26, 2026 at 11:28=E2=80=AFAM PG Bug reporting form wrote: > #0 0x0000564830c3c9d1 in dsa_free (area=3D0x5648621a9280, dp=3D) > at ./build/../src/backend/utils/mmgr/dsa.c:845 > 845 ./build/../src/backend/utils/mmgr/dsa.c: No such file or director= y. > (gdb) bt full > #0 0x0000564830c3c9d1 in dsa_free (area=3D0x5648621a9280, dp=3D) > at ./build/../src/backend/utils/mmgr/dsa.c:845 > segment_map =3D 0x5648621a92b8 > pageno =3D 0 > span_pointer =3D 0 > span =3D > superblock =3D > object =3D > size =3D > size_class =3D > #1 0x0000564830917ae1 in ExecHashTableDetach (hashtable=3D0x564862147fa0= ) at > ./build/../src/backend/executor/nodeHash.c:3439 > i =3D > pstate =3D 0x7ef9970b5040 Hmm, it's not supposed to be possible for two backends to reach the dsa_free() at nodeHash.c:3439. But it does smell a bit like that that's what happened... hmmm. We were in _RUN phase, and then this barrier should only let one process through to _FREE. I'd be interested in the contents of pstate->build_barrier in frame 1 if you get another core file with the same stack in it. Can you share the outline of the query plan? Does it happen to have a full/right PHJ in it? /* If we're last to detach, clean up shared memory. */ if (BarrierArriveAndDetach(&pstate->build_barrier)) { /* * Late joining processes will see this state and give up * immediately. */ Assert(BarrierPhase(&pstate->build_barrier) =3D=3D PHJ_BUILD_FR= EE); if (DsaPointerIsValid(pstate->batches)) { dsa_free(hashtable->area, pstate->batches); pstate->batches =3D InvalidDsaPointer; } }