pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM
2+ messages / 2 participants
[nested] [flat]
* BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM
@ 2023-12-07 11:21 PG Bug reporting form <noreply@postgresql.org>
2023-12-07 14:30 ` Re: BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2023-12-07 11:21 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: rekgrpth@gmail.com
The following bug has been logged on the website:
Bug reference: 18232
Logged by: RekGRpth
Email address: rekgrpth@gmail.com
PostgreSQL version: 16.1
Operating system: all
Description:
Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY,
WJB_VALUE and WJB_ELEM
So I can call pushJsonbValue(NULL, WJB_VALUE, NULL) and get Segmentation
fault
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM
2023-12-07 11:21 BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM PG Bug reporting form <noreply@postgresql.org>
@ 2023-12-07 14:30 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2023-12-07 14:30 UTC (permalink / raw)
To: rekgrpth@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY,
> WJB_VALUE and WJB_ELEM
> So I can call pushJsonbValue(NULL, WJB_VALUE, NULL) and get Segmentation
> fault
What's your point? If we did have such Asserts, the process would
still crash if you did that.
In general I don't find a lot of value in Assert'ing that a pointer
isn't null in code that is about to dereference it. You'll get a
clearly-interpretable process crash either way, so an Assert seems
like useless code bloat. Others might have a different opinion,
but surely this is a matter of style not a bug. We've not chosen
to have any particular project style on this point.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-12-07 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 11:21 BUG #18232: Function pushJsonbValueScalar has not Assert(scalarVal) on WJB_KEY, WJB_VALUE and WJB_ELEM PG Bug reporting form <noreply@postgresql.org>
2023-12-07 14:30 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox