pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix jit compilation bug on wide tables.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix jit compilation bug on wide tables.
@ 2018-11-27 18:08 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2018-11-27 18:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix jit compilation bug on wide tables.

The function generated to perform JIT compiled tuple deforming failed
when HeapTupleHeader's t_hoff was bigger than a signed int8. I'd
failed to realize that LLVM's getelementptr would treat an int8 index
argument as signed, rather than unsigned.  That means that a hoff
larger than 127 would result in a negative offset being applied.  Fix
that by widening the index to 32bit.

Add a testcase with a wide table. Don't drop it, as it seems useful to
verify other tools deal properly with wide tables.

Thanks to Justin Pryzby for both reporting a bug and then reducing it
to a reproducible testcase!

Reported-By: Justin Pryzby
Author: Andres Freund
Discussion: https://postgr.es/m/20181115223959.GB10913@telsasoft.com
Backpatch: 11, just as jit compilation was

Branch
------
master

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

Modified Files
--------------
src/backend/jit/llvm/llvmjit_deform.c      | 12 +++++++++---
src/test/regress/expected/create_table.out | 10 ++++++++++
src/test/regress/expected/sanity_check.out |  1 +
src/test/regress/sql/create_table.sql      | 10 ++++++++++
4 files changed, 30 insertions(+), 3 deletions(-)



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

* pgsql: Fix jit compilation bug on wide tables.
@ 2018-11-27 18:08 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2018-11-27 18:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix jit compilation bug on wide tables.

The function generated to perform JIT compiled tuple deforming failed
when HeapTupleHeader's t_hoff was bigger than a signed int8. I'd
failed to realize that LLVM's getelementptr would treat an int8 index
argument as signed, rather than unsigned.  That means that a hoff
larger than 127 would result in a negative offset being applied.  Fix
that by widening the index to 32bit.

Add a testcase with a wide table. Don't drop it, as it seems useful to
verify other tools deal properly with wide tables.

Thanks to Justin Pryzby for both reporting a bug and then reducing it
to a reproducible testcase!

Reported-By: Justin Pryzby
Author: Andres Freund
Discussion: https://postgr.es/m/20181115223959.GB10913@telsasoft.com
Backpatch: 11, just as jit compilation was

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/jit/llvm/llvmjit_deform.c      | 12 +++++++++---
src/test/regress/expected/create_table.out | 10 ++++++++++
src/test/regress/expected/sanity_check.out |  1 +
src/test/regress/sql/create_table.sql      | 10 ++++++++++
4 files changed, 30 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2018-11-27 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 18:08 pgsql: Fix jit compilation bug on wide tables. Andres Freund <andres@anarazel.de>
2018-11-27 18:08 pgsql: Fix jit compilation bug on wide tables. Andres Freund <andres@anarazel.de>

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