Re: JIT breaks PostGIS - Mailing list pgsql-hackers

From Darafei "Komяpa" Praliaskouski
Subject Re: JIT breaks PostGIS
Date
Msg-id CAC8Q8t+=17oZ4TZGcPn-1BaTCO0_45TBxoc2AssG1Y9A9B6SKQ@mail.gmail.com
Whole thread Raw
In response to Re: JIT breaks PostGIS  (Andres Freund <andres@anarazel.de>)
Responses Re: JIT breaks PostGIS  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
Hello,

пн, 23 июл. 2018 г. в 8:13, Andres Freund <andres@anarazel.de>:
Hi,

On 2018-07-21 23:14:47 +0300, Darafei "Komяpa" Praliaskouski wrote:
>
> I suspect that a fix would require to bisect llvm/clang version which stops
> showing this behavior and making it a new minimum for JIT, if this is not a
> symptom of bigger (memory management?) problem.

It looks to me like it's a LLVM issue, specifically https://bugs.llvm.org/show_bug.cgi?id=34424
fixed in LLVM 5+.

Thank you for your investigation.
 
It'll only be an issue for extensions that throw c++ style exceptions. I
don't think that rises to the level of disallowing any LLVM version <
5.0. I suggest postgis adds an error check to its buildprocess that
refuses to run if jit is enabled and a too old version is used?

Unfortunately that's not an option.

Debian Stretch amd64 is quite popular platform, and is supported by Postgres 10 / PostGIS 2.4.

If Christoph decides to keep LLVM enabled for 11 on that platform, as he is recommended upthread by Tom, that would mean that PostGIS can't be packaged at all, and all the people who need it will have to stay on Postgres 10.

If PostGIS decides not to implement the check, and instead tweaks test runner to execute `set jit to off;` before tickets.sql, then Postgres 11 on that platform will have a known way to segfault it, even without superuser rights, as jit GUC is tweakable by anyone.

I think that a good way to deal with it will be to bump minimum required version of LLVM to 5 on Postgres build, with a notice in docs that will say that "you can build with lower version, but that will give you this and this bug". 

It also may happen that a patch for LLVM can be applied to LLVM4 build in Debian and brought in as an update, but such a plan should not be a default one.
--
Darafei Praliaskouski
Support me: http://patreon.com/komzpa

pgsql-hackers by date:

Previous
From: Ibrar Ahmed
Date:
Subject: Re: Log query parameters for terminated execute
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Fix calculations on WAL recycling.