Re: JIT causes core dump during error recovery
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-06-27T16:59:37Z
Lists: pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> Em qui., 27 de jun. de 2024 às 13:18, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
>> In any case, I found that adding some copying logic to CopyErrorData()
>> is enough to solve this problem, since the SPI infrastructure applies
>> that before executing xact cleanup.
> In this case, I think that these fields, in struct definition struct
> ErrorData (src/include/utils/elog.h)
> should be changed too?
> from const char * to char*
No, that would imply casting away const in errstart() etc. We're
still mostly expecting those things to be pointers to constant
strings.
I'm about half tempted to file this as an LLVM bug. When it inlines
a function, it should still reference the same string constants that
the original code did, otherwise it's failing to be a transparent
conversion. But they'll probably cite some standards-ese that claims
this is undefined behavior:
const char * foo(void) { return "foo"; }
void bar(void) { Assert( foo() == foo() ); }
on which I call BS, but it's probably in there somewhere.
regards, tom lane
Commits
-
Avoid crashing when a JIT-inlined backend function throws an error.
- dccda847b709 12.20 landed
- 86fac88eed4b 13.16 landed
- 5401e70e47aa 15.8 landed
- 13abc1f66074 14.13 landed
- 5d6c64d29097 17.0 landed
- 07d66d3cc2a9 16.4 landed