Re: JIT causes core dump during error recovery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: JIT causes core dump during error recovery
Date: 2024-06-27 16:59:37
Message-ID: 1753831.1719507577@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> Em qui., 27 de jun. de 2024 às 13:18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marthin Laubscher 2024-06-27 17:01:10 Re: Custom type's modifiers
Previous Message Heikki Linnakangas 2024-06-27 16:35:05 Re: Backporting BackgroundPsql