Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6Zbe-0003Nc-LW for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Jul 2021 14:23:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6Zbd-0001Vf-Ln for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Jul 2021 14:23:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6ZQ1-0006Tv-Ko for pgsql-bugs@lists.postgresql.org; Thu, 22 Jul 2021 14:11:21 +0000 Received: from sprint-2.amdmi3.ru ([2a0a:2b41:94:cb5e::]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6ZPw-0004iX-Qt for pgsql-bugs@postgresql.org; Thu, 22 Jul 2021 14:11:20 +0000 Received: from amdmi3.ru (localhost [IPv6:::1]) by sprint-2.amdmi3.ru (Postfix) with SMTP id 04845188611; Thu, 22 Jul 2021 17:11:13 +0300 (MSK) Received: by amdmi3.ru (nbSMTP-1.00) for uid 1000 amdmi3@amdmi3.ru; Thu, 22 Jul 2021 17:11:13 +0300 (MSK) Date: Thu, 22 Jul 2021 17:06:34 +0300 From: Dmitry Marakasov To: Thomas Munro Cc: Andres Freund , Palle , pgsql-bugs@postgresql.org Subject: Re: BUG #16696: Backend crash in llvmjit Message-ID: References: <16696-29d944a33801fbfe@postgresql.org> <20201102214509.GV30304@hades.panopticon> <7463da2f-80f2-43c4-81d4-c3bab1f040b4@www.fastmail.com> <20201104212015.GA30304@hades.panopticon> <20201110054802.bjmjkfv4gzj3nkbe@alap3.anarazel.de> <20201116004529.GC5149@hades.panopticon> <1621435742019-0.post@n3.nabble.com> <20210721165927.3x6cazq3hsni6m7r@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk * Thomas Munro (thomas.munro@gmail.com) wrote: > On Thu, Jul 22, 2021 at 4:59 AM Andres Freund wrote: > > On 2021-07-18 17:13:50 +1200, Thomas Munro wrote: > > > On Thu, May 20, 2021 at 2:49 AM Palle 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! Superb, thanks a lot! -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: https://github.com/AMDmi3 https://amdmi3.ru