pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix leak of LLVM "fatal-on-oom" section counter.
Date: Wed, 05 Jul 2023 10:34:59 +0000
Message-ID: <E1qGzqd-00212C-GN@gemulon.postgresql.org> (raw)

Fix leak of LLVM "fatal-on-oom" section counter.

llvm_release_context() called llvm_enter_fatal_on_oom(), but was missing
the corresponding llvm_leave_fatal_on_oom() call. As a result, if JIT was
used at all, we were almost always in the "fatal-on-oom" state.

It only makes a difference if you use an extension written in C++, and
run out of memory in a C++ 'new' call. In that case, you would get a
PostgreSQL FATAL error, instead of the default behavior of throwing a
C++ exception.

Back-patch to all supported versions.

Reviewed-by: Daniel Gustafsson
Discussion: https://www.postgresql.org/message-id/54b78cca-bc84-dad8-4a7e-5b56f764fab5@iki.fi

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fa96a74a0f76c49ac5a43a16fca8bf705fa98d99

Modified Files
--------------
src/backend/jit/llvm/llvmjit.c | 2 ++
1 file changed, 2 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1qGzqd-00212C-GN@gemulon.postgresql.org>
Permalink:  ../E1qGzqd-00212C-GN@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qGzqd-00212C-GN@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix leak of LLVM "fatal-on-oom" section counter.
  In-Reply-To: <E1qGzqd-00212C-GN@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox