Fix jit compilation bug on wide tables.
Andres Freund <andres@anarazel.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/jit/llvm/llvmjit_deform.c | modified | +9 −3 |
| src/test/regress/expected/create_table.out | modified | +10 −0 |
| src/test/regress/expected/sanity_check.out | modified | +1 −0 |
| src/test/regress/sql/create_table.sql | modified | +10 −0 |
Discussion
- pg11.1 jit segv 21 messages · 2018-11-15 → 2018-11-27