Re: 012_subtransactions.pl vs clang -fsanitize=undefined

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: 012_subtransactions.pl vs clang -fsanitize=undefined
Дата
Msg-id CA+hUKG+AAz2cMBtizgEftmneOk_=g_c4Hx_4JDq5KnuoKKYfAg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 012_subtransactions.pl vs clang -fsanitize=undefined  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jul 25, 2022 at 10:18 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
> > I think what's happening is just that this build configuration
> > eats stack extravagantly.
>
> That's definitely it, but I don't entirely see why.  Here are a
> couple of major offenders though:

Interesting.  I wonder where we can read about what stuff clang puts
on the stack to implement the undefined behaviour checker (and what
GCC does differently here), but today I will resist the urge to go
looking.

As for workarounds (and as a note for my future self next time I'm
testing with UBSan), this is enough for the test to pass on my dev box
(4MB is not enough):

--- a/src/test/recovery/t/012_subtransactions.pl
+++ b/src/test/recovery/t/012_subtransactions.pl
@@ -16,6 +16,7 @@ $node_primary->append_conf(
        'postgresql.conf', qq(
        max_prepared_transactions = 10
        log_checkpoints = true
+       max_stack_depth = 5MB
 ));

It's also possible to tell it to keep out of certain functions:


https://github.com/llvm/llvm-project/blob/main/clang/docs/UndefinedBehaviorSanitizer.rst#disabling-instrumentation-with-attribute-no-sanitize-undefined



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 012_subtransactions.pl vs clang -fsanitize=undefined
Следующее
От: Kenaniah Cerny
Дата:
Сообщение: Re: Proposal: allow database-specific role memberships