Re: Fix NO_OOM handling in MemoryContextAllocAligned

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix NO_OOM handling in MemoryContextAllocAligned
Date: 2026-08-04 04:11:33
Message-ID: CAApHDvr9xqWUViK_7Vhdy_xry+ww7rLHU5ao8UwLNcr5a9JXyQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 3 Aug 2026 at 20:50, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> MemoryContextAllocAligned() calls MemoryContextAllocExtended() and passes “flags" with only MCXT_ALLOC_ZERO removed. When “flags" includes MCXT_ALLOC_NO_OOM, MemoryContextAllocExtended() may return NULL, but MemoryContextAllocAligned() doesn't handle the returned NULL, which may
> lead to a crash.

Thanks. Pushed.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-08-04 04:45:35 Re: Fix NO_OOM handling in MemoryContextAllocAligned
Previous Message solai v 2026-08-04 03:53:11 Re: XMLSerialize: version and explicit XML declaration