Re: JIT breaks PostGIS

From: Darafei "Komяpa" Praliaskouski <me(at)komzpa(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: JIT breaks PostGIS
Date: 2018-07-23 10:42:02
Message-ID: CAC8Q8t+=17oZ4TZGcPn-1BaTCO0_45TBxoc2AssG1Y9A9B6SKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

пн, 23 июл. 2018 г. в 8:13, Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-07-23 10:55:57 Re: Fix calculations on WAL recycling.
Previous Message Ibrar Ahmed 2018-07-23 10:34:38 Re: Log query parameters for terminated execute