Re: BUG #16696: Backend crash in llvmjit

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Palle <girgen(at)pingpong(dot)net>, pgsql-bugs(at)postgresql(dot)org, Dmitry Marakasov <amdmi3(at)amdmi3(dot)ru>
Subject: Re: BUG #16696: Backend crash in llvmjit
Date: 2021-07-22 03:30:32
Message-ID: CA+hUKGK6J+Zsa1j-pjKAJmqRq6=E55Tr2EX_WoZ2j0RNYgXo-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jul 22, 2021 at 4:59 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2021-07-18 17:13:50 +1200, Thomas Munro wrote:
> > On Thu, May 20, 2021 at 2:49 AM Palle <girgen(at)pingpong(dot)net> wrote:
> > > This seems to still not be fixed. Is it planned for 14.0 release?
> >
> > I don't know enough about LLVM and TLS to have an opinion on the
> > details, but I tested this and it works, and I think it should
> > probably be back-patched based on the discussion so far (and hopefully
> > in the future some way can be figured out to make it actually work?).

Done.

For the record, the original repro now causes PostgreSQL on FreeBSD
(with INLINE_DEBUG defined) to say:

2021-07-22 15:20:51.738 NZST [82982] DEBUG: checking inlinability of boolin
2021-07-22 15:20:51.738 NZST [82982] DEBUG: cannot inline boolin due
to thread-local variable _ThreadRuneLocale
2021-07-22 15:20:51.738 NZST [82982] DEBUG: had to skip inlining boolin

> FWIW, there's ongoing work in llvm to make the jit stuff handle TLS
> correctly.

Cool.

Dmitry: Thanks very much for the report, reproducer, analysis and patch!

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2021-07-22 06:20:28 Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)
Previous Message PG Bug reporting form 2021-07-21 19:38:02 BUG #17118: ALTER TABLE doesn't discard redundant UNIQUE constraints as CREATE TABLE will