Re: Segfault in jit tuple deforming on arm64 due to LLVM issue

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Segfault in jit tuple deforming on arm64 due to LLVM issue
Date: 2024-08-26 21:06:29
Message-ID: CA+hUKG+1BtvnUT+NiUu9ASqiMJ6Y6_+aHu_3SWkB6gF0ZQgaAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 27, 2024 at 2:16 AM Anthonin Bonnefoy
<anthonin(dot)bonnefoy(at)datadoghq(dot)com> wrote:
> There's a possible alternative, but it's definitely in the same
> category as the hot-patching idea. llvmjit uses
> LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager to
> create the ObjectLinkingLayer and it will be created with the default
> SectionMemoryManager[2]. It should be possible to provide a modified
> SectionMemoryManager with the change to allocate sections in a single
> block and it could be restricted to arm64 architecture. A part of me
> tells me this is probably a bad idea but on the other hand, LLVM
> provides this way to plug a custom allocator and it would fix the
> issue...

Interesting. Here is a quick hack to experiment with injecting a new
memory manager. This one just wraps the normal one and logs the
addresses it allocates, but from here, you're right, we could try to
constraint its address range somehow (or perhaps just check its range
and fail gracefully).

Attachment Content-Type Size
0001-XXX-replace-LLVM-SectionMemoryManager.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-08-26 21:18:21 Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM
Previous Message Andrei Lepikhov 2024-08-26 20:01:53 Re: allowing extensions to control planner behavior