Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l - Mailing list pgsql-bugs

From Andrey Rachitskiy
Subject Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l
Date
Msg-id CAB8bMitea+w7igvgag4wVa5wS-Zh5HVONJK0AKELxdgxFSM5JQ@mail.gmail.com
Whole thread
In response to Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
вс, 16 авг. 2026 г. в 11:05, Michael Paquier <michael@paquier.xyz>:
I don't follow this argument.  ParseConfigFp(), ParseConfigFile() or
ProcessConfigFile() can be called with an elevel lower than ERROR, and
we have quite a few callers that do so. 

Sorry, that argument was too narrow. I was only looking at the
longjmp from a flex fatal, where the scanner is already live.

It seems to me that we should also have a `goto cleanup` if
yylex_init() fails, also pointing at d663f150b5ed that has switched
the scanner to be reentrant where yylex_init() has been added.

Agreed.
One gap in the snippet: OK is still true on that path, so we would
report a successful parse.  That should be:
```
if (yylex_init(&scanner_init) != 0)
{
elog(elevel, "yylex_init() failed: %m");
OK = false;
goto cleanup;
}
```
With that, I am fine taking your version.

--
Regards,
Rachitskiy Andrey

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l
Next
From: "zengman"
Date:
Subject: Re:BUG #19625: SQL/JSON boolean DEFAULT expression silently replaced with 'false'