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.98.2) (envelope-from ) id 1xKyMD-00000001ECd-0IlC for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Oct 2026 13:33:53 +0000 Received: from localhost ([127.0.0.1]:33964 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xKyMC-000000034TO-2d56 for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Oct 2026 13:33:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:38644) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xKsDA-00000002JJW-1hxS for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2026 07:00:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xKsD8-00000000otJ-21u3 for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2026 07:00:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=351v20UTQMI5OVT4ulMfkOI3+yqQfSaIbihL2OV0KKQ=; b=L87uiPur1V24X3A+U37tJsoArl VPtE2s3rmvIjKD2kFZZbZ99JjC9rQZtxyKcj+rCt4G10hIwTEtK++heEA3wk2PmYNr2q0jT9Oglm/ Coxar8n943C13YmtNFgEYb5Ij+/Ym012iN1LsIQZtHweTdNQCBcvp/vZpH2r4skXAEpbiQJwqMNEZ u+Ea3tWqeSUaj13aqENkRZ7tHddwvC9BKC1eBs1Cv3kg0FCs8G0MAz5A51R83JQJKcLY6kLLRppo0 EU9DCeTyDmyVATvHbcVsSVby0RUhoynfRd4PrlFJW4yaMEBjpCZ65qpmWDe+PeM3xRpdSu0ykoqC8 Fk2Fb7qQ==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xKsD7-00000002NH5-3gd8 for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2026 07:00:06 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xKsD6-000000078RL-3RKT for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2026 07:00:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19796: io_uring crashes with specific kernel/liburing versions + io_max_concurrency due to rings overlap To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: exclusion@gmail.com Reply-To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Date: Sun, 25 Oct 2026 07:00:02 +0000 Message-ID: <19796-ee6b17b2c500ed5e@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19796 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 19rc1 Operating system: Ubuntu 24.04 Description: =20 The following script: psql -c "CREATE TABLE t AS SELECT repeat('x', 100) FROM generate_series(1, 500000)" echo "SELECT count(*) FROM t" > /tmp/q.sql pgbench -n -f /tmp/q.sql -c 4 -T 60 with these parameters set: io_method =3D io_uring io_max_concurrency =3D 1024 shared_buffers =3D 16MB max_connections =3D 30 crashes on Ubuntu 24.04 as below: 2026-10-25 06:03:22.401 UTC [39572] PANIC: io_uring submit submitted only 0 of 1 2026-10-25 06:03:22.401 UTC [39572] STATEMENT: SELECT count(*) FROM t 2026-10-25 06:03:22.401 UTC [39523] ERROR: io_uring submit submitted only 0 of 1 2026-10-25 06:03:22.401 UTC [39523] CONTEXT: parallel worker or TRAP: failed Assert("ioh->state =3D=3D PGAIO_HS_SUBMITTED"), File: "aio.c", Line: 530, PID: 39816 ExceptionalCondition at assert.c:51:13 pgaio_io_process_completion at aio.c:532:2 pgaio_uring_drain_locked at method_io_uring.c:565:20 pgaio_uring_wait_one at method_io_uring.c:643:4 pgaio_io_wait at aio.c:623:6 pgaio_wref_wait at aio.c:999:1 WaitReadBuffers at bufmgr.c:1831:17 read_stream_next_buffer at read_stream.c:1191:17 heap_fetch_next_buffer at heapam.c:743:16 heapgettup_pagemode at heapam.c:1110:8 heap_getnextslot at heapam.c:1484:3 table_scan_getnextslot at tableam.h:1105:1 SeqNext at nodeSeqscan.c:90:5 ... With this logging added: --- a/src/backend/storage/aio/method_io_uring.c +++ b/src/backend/storage/aio/method_io_uring.c @@ -357,6 +357,12 @@ pgaio_uring_shmem_init(void *arg) struct io_uring_params p =3D {0}; =20 ret =3D io_uring_queue_init_mem(io_max_concurrency, &context->io_uring_ring, &p, ring_mem_next, ring_mem_remain); +if (ret > 0) +{ + int overlap =3D (char *) (context->io_uring_ring.sq.array + p.sq_entries) - (ring_mem_next + ret); + if (overlap > 0) + elog(LOG, "!!!pgaio_uring_shmem_init| io_uring ring %d overlaps the next ring by %d bytes", contextno, overlap); +} =20 ring_mem_remain -=3D ret; ring_mem_next +=3D ret; I can see: 2026-10-25 06:04:51.347 UTC [39804] LOG: !!!pgaio_uring_shmem_init| io_uring ring 0 overlaps the next ring by 64 bytes 2026-10-25 06:04:51.347 UTC [39804] LOG: !!!pgaio_uring_shmem_init| io_uring ring 1 overlaps the next ring by 64 bytes ... 2026-10-25 06:04:51.352 UTC [39804] LOG: !!!pgaio_uring_shmem_init| io_uring ring 70 overlaps the next ring by 64 bytes 2026-10-25 06:04:51.352 UTC [39804] LOG: !!!pgaio_uring_shmem_init| io_uring ring 71 overlaps the next ring by 64 bytes 2026-10-25 06:04:51.354 UTC [39804] LOG: starting PostgreSQL 20devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, 64-bit I observed this on Ubuntu machines with kernels: Linux a 7.0.0-1014-aws #14~24.04.1-Ubuntu SMP PREEMPT Fri Sep 18 21:50:22 UTC 2026 aarch64 aarch64 aarch64 GNU/Linux Linux b 6.14.1-061401-generic #202504071048 SMP PREEMPT_DYNAMIC Mon Apr 7 11:20:41 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux and liburing 2.5. The issue is not reproduced after https://github.com/axboe/liburing/commit/9f4464d.