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: llvmjit: Also copy parameter / return value attributes from temp
Date: Thu, 15 Oct 2020 22:22:30 +0000
Message-ID: <E1kTBdm-0004TW-IA@gemulon.postgresql.org> (raw)

llvmjit: Also copy parameter / return value attributes from template functions.

Previously we only copied the function attributes. That caused problems at
least on s390x: Because we didn't copy the 'zeroext' attribute for
ExecAggTransReparent()'s *IsNull parameters, expressions invoking it didn't
ensure that the upper bytes of the registers were zeroed. In the - relatively
rare - cases where not, ExecAggTransReparent() wrongly ended up in the
newValueIsNull branch due to the register not being zero. Subsequently causing
a crash.

It's quite possible that this would cause problems on other platforms, and in
other places than just ExecAggTransReparent() on s390x.

Thanks to Christoph (and the Debian project) for providing me with access to a
s390x machine, allowing me to debug this.

Reported-By: Christoph Berg
Author: Andres Freund
Discussion: https://postgr.es/m/20201015083246.kie5726xerdt3ael@alap3.anarazel.de
Backpatch: 11-, where JIT was added

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/jit/llvm/llvmjit.c | 44 ++++++++++++++++++++++++++++++------------
1 file changed, 32 insertions(+), 12 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1kTBdm-0004TW-IA@gemulon.postgresql.org>
Permalink:  ../E1kTBdm-0004TW-IA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kTBdm-0004TW-IA@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: llvmjit: Also copy parameter / return value attributes from temp
  In-Reply-To: <E1kTBdm-0004TW-IA@gemulon.postgresql.org>
  References: <E1kTBdm-0004TW-IA@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