public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniel Gustafsson <[email protected]>
To: Jacob Champion <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Subject: Re: jsonapi: scary new warnings with LTO enabled
Date: Mon, 21 Apr 2025 20:46:01 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOYmi+k+Cv4PrD9HWRh2gzZLweKK+375hBV0-N4Q9Zzb5PM24w@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAOYmi+n+DHpaEV5hymhufutTgc+S=+pDQfXEUi4hMAV1eO8aTw@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CAOYmi+mxjW0GhSGPKoOy3TYrFcdTM=5FcUn=u1i7CFhb2303Zg@mail.gmail.com>
<[email protected]>
<CAOYmi+=w3Q-3F=LCr9hPRhiG2HGv6sogGOJW3v9pwpoCD6wN+w@mail.gmail.com>
<[email protected]>
<CAOYmi+k+Cv4PrD9HWRh2gzZLweKK+375hBV0-N4Q9Zzb5PM24w@mail.gmail.com>
> On 21 Apr 2025, at 20:28, Jacob Champion <[email protected]> wrote:
>
> On Mon, Apr 21, 2025 at 11:20 AM Daniel Gustafsson <[email protected]> wrote:
>> Sure, but I fear we'll get an endless stream of static analysis reports for the
>> allocation leaking if we don't free it.
>
> But we do free it, in freeJsonLexContext(). That usage of the API goes
> back to 2023, with 1c99cde2f344. Or am I misunderstanding?
We do, but with the current coding we call setJsonLexContextOwnsTokens
immediately after creation which derefences the pointer without checkinf for
allocation failure. This means we dereference the pointer before we can check
for an OOM return from pg_parse_json which even if safe seems to violate code
readability no?
--
Daniel Gustafsson
view thread (9+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: jsonapi: scary new warnings with LTO enabled
In-Reply-To: <[email protected]>
* 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