agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Cc: michaelmalis2@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3
Date: Sun, 30 Aug 2026 00:04:07 -0400
Message-ID: <445119.1788062647@sss.pgh.pa.us> (raw)
In-Reply-To: <2ab10d25-7dc6-4914-8aea-ca0adfbe57c3@gmail.com>
References: <19595-7dc18b4e212c4757@postgresql.org>
	<CAB8bMiun+cTqTnv-cTfxvTbnOLxWunRgyZeUZ88YMSLLXub4mg@mail.gmail.com>
	<325748.1785691547@sss.pgh.pa.us>
	<0f3ddeb5-0dbd-479c-9d0e-ae254758e624@gmail.com>
	<336527.1785701494@sss.pgh.pa.us>
	<2ab10d25-7dc6-4914-8aea-ca0adfbe57c3@gmail.com>

Alexander Lakhin <exclusion@gmail.com> writes:
> I discovered one more issue in this area. This OOM condition emulation:
> --- a/src/backend/snowball/libstemmer/api.c
> +++ b/src/backend/snowball/libstemmer/api.c
> @@ -6,3 +6,3 @@ extern struct SN_env * SN_new_env(int alloc_size)
>   {
> -    struct SN_env * z = (struct SN_env *) malloc(alloc_size);
> +    struct SN_env * z = (rand() % 2 == 0) ? NULL : (struct SN_env *) malloc(alloc_size);
>       if (z == NULL) return NULL;

> leads to `make check` crashes like:

Hmph.  SN_new_env itself is visibly okay with this, so the failure is
in some caller.  I'm too tired to dig into it myself, but can you
identify the culprit more precisely?

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <445119.1788062647@sss.pgh.pa.us>
Permalink:  ../445119.1788062647@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/445119.1788062647@sss.pgh.pa.us

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, pl0h0yp1@gmail.com, michaelmalis2@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3
  In-Reply-To: <445119.1788062647@sss.pgh.pa.us>

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

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