agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Chao Li <li.evan.chao@gmail.com>
Cc: Euler Taveira <euler@eulerto.com>
Cc: japin <japinli@hotmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: log_min_messages per backend type
Date: Tue, 21 Jul 2026 11:39:41 +0200
Message-ID: <87bjc0heaq.fsf@gmail.com> (raw)
In-Reply-To: <al4PzUn6y82eP-t1@alvherre.pgsql>
References: <al4PzUn6y82eP-t1@alvherre.pgsql>

Hello!


Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Hello,
>
> Here's a couple of trivial cleanups of this code.  0001 simplifies code
> and removes a duplicate by creating a small subroutine; 0002 also
> simplifies memory freeing a tad, by freeing allocations as soon as
> no longer needed instead of waiting and being forced to duplicate the
> frees in several places.
>
> This is two commits here just for ease of review, but I'd probably push
> as one commit (and without backpatch).

The first commit passed without problems and works like a charm, but the
second one is breaking the detection of the messages here:

@@ -2392,6 +2393,8 @@ check_log_min_messages(char **newval, void **extra, GucSource source)
                guc_free(rawstring);
                return false;
        }
+       rawstring_len = strlen(rawstring);
+       guc_free(rawstring);


The rawstring is being reference in the elemlist, so the free is making
the string empty when is going to be used later:

(gdb) print rawstring
$17 = 0x555556f85e08 ""
(gdb) print *elemlist->elements
$18 = {
  ptr_value = 0x555556f85e08,
  int_value = 1459117576,
  oid_value = 1459117576,
  xid_value = 1459117576
}

Regards!
--
Jonathan Gonzalez V.
EDB
https://www.enterprisedb.com






view thread (58+ messages)  latest in thread

Message-ID: <87bjc0heaq.fsf@gmail.com>
Permalink:  ../87bjc0heaq.fsf@gmail.com/
Also on:    postgresql.org/message-id/87bjc0heaq.fsf@gmail.com

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-hackers@postgresql.org
  Cc: jonathan.abdiel@gmail.com, alvherre@alvh.no-ip.org, li.evan.chao@gmail.com, euler@eulerto.com, japinli@hotmail.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: log_min_messages per backend type
  In-Reply-To: <87bjc0heaq.fsf@gmail.com>

* 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