Re: How to test Postgres for any unaligned memory accesses?

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: How to test Postgres for any unaligned memory accesses?
Дата
Msg-id CALj2ACU=OtVXRAJmcgNcWLdBmHiNxksuPEgdZD2hnCF8dGHHwg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to test Postgres for any unaligned memory accesses?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Apr 23, 2021 at 7:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > I'm not sure this is the right way. I would like to know whether there
> > is a standard way of testing Postgres code for any unaligned memory
> > accesses. Thanks. Any help would be appreciated.
>
> Per c.h, late-model compilers have options for this:
>
>  * Testing can be done with "-fsanitize=alignment -fsanitize-trap=alignment"
>  * on clang, or "-fsanitize=alignment -fno-sanitize-recover=alignment" on gcc.

Thanks Tom!

I used the above gcc compiler flags to see if they catch memory
alignment issues. The way I tested on my dev system (x86_64 platform
with Ubuntu OS)  was that I commented out max aligning specialSize in
PageInit, compiled the source code with and without the alignment
flags. make check failed with the alignment checking flags, it passed
without the flags.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



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

Предыдущее
От: "tanghy.fnst@fujitsu.com"
Дата:
Сообщение: RE: use pg_strncasecmp to replace strncmp when compare "pg_"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Does rewriteTargetListIU still need to add UPDATE tlist entries?