| From: | "Jonathan Gonzalez V(dot)" <jonathan(dot)abdiel(at)gmail(dot)com> |
|---|---|
| To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, japin <japinli(at)hotmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: log_min_messages per backend type |
| Date: | 2026-07-21 09:39:41 |
| Message-ID: | 87bjc0heaq.fsf@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hello!
Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Matthias van de Meent | 2026-07-21 09:41:58 | Re: Unexpected behavior after OOM errors |
| Previous Message | Imran Zaheer | 2026-07-21 09:28:01 | Re: [WIP] Pipelined Recovery |