agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: pgbench: fix verbose error message corruption with multiple thre
5+ messages / 1 participants
[nested] [flat]

* pgsql: pgbench: fix verbose error message corruption with multiple thre
@ 2026-05-14 03:32 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-05-14 03:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pgbench: fix verbose error message corruption with multiple threads

When pgbench runs with multiple threads and verbose error reporting is
enabled (--verbose-errors), multiple clients can build verbose error
messages concurrently. Previously, a function-local static
PQExpBuffer was used for these messages, causing the buffer to be
shared across threads. This was not thread-safe and could result in
corrupted or incorrect log output.

Fix this by using a local PQExpBufferData instead of a static buffer.
This keeps verbose error messages correct during concurrent execution.

Backpatch to v15, where this issue was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alex Guo <guo.alex.hengchen@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwER1AjGXpkKB9t9820NBhMQ_Ghv7=HsKeodUr3=SZsF4g@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/61f8a85a577fd0ea0bf924a88064187bed31eb48

Modified Files
--------------
src/bin/pgbench/pgbench.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: pgbench: fix verbose error message corruption with multiple thre
@ 2026-05-14 03:32 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-05-14 03:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pgbench: fix verbose error message corruption with multiple threads

When pgbench runs with multiple threads and verbose error reporting is
enabled (--verbose-errors), multiple clients can build verbose error
messages concurrently. Previously, a function-local static
PQExpBuffer was used for these messages, causing the buffer to be
shared across threads. This was not thread-safe and could result in
corrupted or incorrect log output.

Fix this by using a local PQExpBufferData instead of a static buffer.
This keeps verbose error messages correct during concurrent execution.

Backpatch to v15, where this issue was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alex Guo <guo.alex.hengchen@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwER1AjGXpkKB9t9820NBhMQ_Ghv7=HsKeodUr3=SZsF4g@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/98dd6c2046965e51da015681e81c20109be46d71

Modified Files
--------------
src/bin/pgbench/pgbench.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: pgbench: fix verbose error message corruption with multiple thre
@ 2026-05-14 03:33 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-05-14 03:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pgbench: fix verbose error message corruption with multiple threads

When pgbench runs with multiple threads and verbose error reporting is
enabled (--verbose-errors), multiple clients can build verbose error
messages concurrently. Previously, a function-local static
PQExpBuffer was used for these messages, causing the buffer to be
shared across threads. This was not thread-safe and could result in
corrupted or incorrect log output.

Fix this by using a local PQExpBufferData instead of a static buffer.
This keeps verbose error messages correct during concurrent execution.

Backpatch to v15, where this issue was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alex Guo <guo.alex.hengchen@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwER1AjGXpkKB9t9820NBhMQ_Ghv7=HsKeodUr3=SZsF4g@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/52b3e7001cb3584ae9f95ac01a185a50cca988cb

Modified Files
--------------
src/bin/pgbench/pgbench.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: pgbench: fix verbose error message corruption with multiple thre
@ 2026-05-14 03:33 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-05-14 03:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pgbench: fix verbose error message corruption with multiple threads

When pgbench runs with multiple threads and verbose error reporting is
enabled (--verbose-errors), multiple clients can build verbose error
messages concurrently. Previously, a function-local static
PQExpBuffer was used for these messages, causing the buffer to be
shared across threads. This was not thread-safe and could result in
corrupted or incorrect log output.

Fix this by using a local PQExpBufferData instead of a static buffer.
This keeps verbose error messages correct during concurrent execution.

Backpatch to v15, where this issue was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alex Guo <guo.alex.hengchen@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwER1AjGXpkKB9t9820NBhMQ_Ghv7=HsKeodUr3=SZsF4g@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6432a4cd68a31ff82b8daa5f713a7a24d00d6ed7

Modified Files
--------------
src/bin/pgbench/pgbench.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: pgbench: fix verbose error message corruption with multiple thre
@ 2026-05-14 03:33 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-05-14 03:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pgbench: fix verbose error message corruption with multiple threads

When pgbench runs with multiple threads and verbose error reporting is
enabled (--verbose-errors), multiple clients can build verbose error
messages concurrently. Previously, a function-local static
PQExpBuffer was used for these messages, causing the buffer to be
shared across threads. This was not thread-safe and could result in
corrupted or incorrect log output.

Fix this by using a local PQExpBufferData instead of a static buffer.
This keeps verbose error messages correct during concurrent execution.

Backpatch to v15, where this issue was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alex Guo <guo.alex.hengchen@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwER1AjGXpkKB9t9820NBhMQ_Ghv7=HsKeodUr3=SZsF4g@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f18fcd9a450b64184d74c3ce6cb6fd79a6499c9f

Modified Files
--------------
src/bin/pgbench/pgbench.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2026-05-14 03:33 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-14 03:32 pgsql: pgbench: fix verbose error message corruption with multiple thre Fujii Masao <fujii@postgresql.org>
2026-05-14 03:32 pgsql: pgbench: fix verbose error message corruption with multiple thre Fujii Masao <fujii@postgresql.org>
2026-05-14 03:33 pgsql: pgbench: fix verbose error message corruption with multiple thre Fujii Masao <fujii@postgresql.org>
2026-05-14 03:33 pgsql: pgbench: fix verbose error message corruption with multiple thre Fujii Masao <fujii@postgresql.org>
2026-05-14 03:33 pgsql: pgbench: fix verbose error message corruption with multiple thre Fujii Masao <fujii@postgresql.org>

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