Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Nov 2020 19:18:42 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 251192] databases/postgresql13-server: fix crashes related to LLVM JIT
Message-ID:  <bug-251192-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251192

            Bug ID: 251192
           Summary: databases/postgresql13-server: fix crashes related to
                    LLVM JIT
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pgsql@FreeBSD.org
          Reporter: amdmi3@FreeBSD.org
          Assignee: pgsql@FreeBSD.org
             Flags: maintainer-feedback?(pgsql@FreeBSD.org)

Created attachment 219740
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D219740&action=
=3Dedit
Patch

I've ran into reproducible postgresql13 crash with LLVM enabled.

Can be reproduced with the following query:

SET jit_above_cost =3D 0;
SET jit_inline_above_cost =3D 0;
SET jit_optimize_above_cost =3D 0;
SELECT (jsonb_array_elements('[true]'::jsonb)->>0)::boolean;

Problem summary: thread local storage access from code inlined by LLVM JIT
instantly crashes (llvm11 also reports an error about unsupported relocatio=
n).
On FreeBSD TLS accesses are quite common as functions like isspace() (used =
in
boolin and input functions for many other commonly used postgresql types)
involve caching of locale specific data in TLS.=20

Upstream bug including details, investigation and a workaround:

https://www.postgresql.org/message-id/flat/16696-29d944a33801fbfe%40postgre=
sql.org#e010f0f56325aac5de96f8d0bb77dec0

For now, I suggest to apply the attached patch which disables inlining of
functions which access TLS. Alternative would be to disable LLVM completely=
 and
mark it BROKEN, but IMO that'd be an overkill.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251192-7788>