| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> |
| Cc: | ilia(dot)kashintsev(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l |
| Date: | 2026-08-16 06:05:13 |
| Message-ID: | aoFTGfKWOFxVZojJ@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Thu, Aug 13, 2026 at 02:00:58PM +0500, Andrey Rachitskiy wrote:
> Thanks for review, and for catching the
> yylex_init() warning. Sorry, I missed that one.
Please do not top-post. Please see:
https://en.wikipedia.org/wiki/Posting_style#Bottom-posting
> The non-volatile copy for yylex_init() looks right. That call writes
> through a yyscan_t *, so &scanner after the volatile change is exactly
> the qualifier discard the compiler reports. Casting the address would
> only silence the warning. scanner_init is never read after the
> longjmp, so it does not need to be volatile.
>
> I would drop the if (scanner) guard in cleanup.
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.
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.
I have been on the edge about backpatching that, but as that's only
v18, perhaps that's OK. It does not change the fact that the error
reported is still confusing if one has the idea to use such a
configuration layer, but I cannot really get convinced that this is
worth tweaking: nobody is going to do that, so I don't really feel bad
about letting flex complain as long as we handle the states accessed
in the sigjumps in a better way.
Thoughts or comments are welcome.
--
Michael
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Fix-ASAN-failure-after-flex-errors-in-GUC-file-pa.patch | text/plain | 2.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrey Rachitskiy | 2026-08-16 06:50:26 | Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l |
| Previous Message | Michael Paquier | 2026-08-15 23:32:16 | Re: SIGSEGV in dynahash |