pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix jit compilation bug on wide tables.
Date: Tue, 27 Nov 2018 18:08:09 +0000
Message-ID: <E1gRhmL-0002cf-DZ@gemulon.postgresql.org> (raw)

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(-)



view thread (2+ messages)

Message-ID: <E1gRhmL-0002cf-DZ@gemulon.postgresql.org>
Permalink:  ../E1gRhmL-0002cf-DZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gRhmL-0002cf-DZ@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Fix jit compilation bug on wide tables.
  In-Reply-To: <E1gRhmL-0002cf-DZ@gemulon.postgresql.org>
  References: <E1gRhmL-0002cf-DZ@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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