Re: ubsan

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ubsan
Date: 2023-09-27 11:00:00
Message-ID: dbf77bf7-6e54-ed8a-c4ae-d196eeb664ce@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Andres,

22.11.2022 02:15, Andres Freund wrote:
> Hi,
>
> On 2022-09-29 18:17:55 -0700, Andres Freund wrote:
>> Attached is a rebased version of this patch. Hopefully with a reasonable
>> amount of comments? I kind of wanted to add a comment to reached_main, but it
>> just seems to end up restating the variable name...
> I've now pushed a version of this with a few cleanups, mostly in
> .cirrus.yml. It'll be interesting to see how many additional problems
> it finds via cfbot.

I've just discovered that that function __ubsan_default_options() is
incompatible with -fsanitize=hwaddress:
$ tmp_install/usr/local/pgsql/bin/postgres
Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
0x000000555639e3ec in __hwasan_check_x0_0 ()
(gdb) bt
#0  0x000000555639e3ec in __hwasan_check_x0_0 ()
#1  0x000000555697b5a8 in __ubsan_default_options () at main.c:446
#2  0x0000005556367e48 in InitializeFlags ()
    at /home/builder/.termux-build/libllvm/src/compiler-rt/lib/hwasan/hwasan.cpp:133
#3  __hwasan_init () at /home/builder/.termux-build/libllvm/src/compiler-rt/lib/hwasan/hwasan.cpp:351
#4  0x0000007ff7f4929c in __dl__ZL13call_functionPKcPFviPPcS2_ES0_ () from /system/bin/linker64
#5  0x0000007ff7f4900c in __dl__ZL10call_arrayIPFviPPcS1_EEvPKcPT_mbS5_ () from /system/bin/linker64
#6  0x0000007ff7f45670 in __dl__ZL29__linker_init_post_relocationR19KernelArgumentBlockR6soinfo ()
   from /system/bin/linker64
#7  0x0000007ff7f449c8 in __dl___linker_init () from /system/bin/linker64
#8  0x0000007ff7f4b208 in __dl__start () from /system/bin/linker64

I use clang version 16.0.6, Target: aarch64-unknown-linux-android24.

With just 'return ""' in __ubsan_default_options(), I've managed to run
`make check` (there is also an issue with check_stack_depth(),
but that's another story)...

Best regards,
Alexander

In response to

  • Re: ubsan at 2022-11-21 23:15:03 from Andres Freund

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2023-09-27 11:07:38 Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning
Previous Message Matthias van de Meent 2023-09-27 10:08:52 Re: Index AmInsert Parameter Confused?