Re: ubsan

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ubsan
Date: 2022-03-23 22:55:28
Message-ID: 20220323225528.hqt66d6mpx66hoal@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-03-23 13:12:34 -0700, Andres Freund wrote:
> I'm planning to enable it on two of mine. Looks like gcc and clang find
> slightly different things, so I was intending to enable it on one of each.

Originally I'd planned to mix them into existing members, but I think it'd be
better to have dedicated ones. Applied for a few new buildfarm names for:
{gcc,clang}-{-fsanitize=undefined,-fsanitize=address}.

Running with asan found an existing use-after-free bug in pg_waldump (*), a bug in
dshash_seq_next() next that probably can't be hit in HEAD and a bug in my
shared memory stats patch. I count that as a success.

It's particularly impressive that the cost of running with ASAN is *so* much
lower than valgrind. On my workstation a check-world with
-fsanitize=alignment,undefined,address takes 3min17s, vs 1min10s or so without
-fsanitize. Not something to always use, but certainly better than valgrind.

Greetings,

Andres Freund

(*) search_directory() uses fname = xlde->d_name after closedir(). Found in
pg_verifybackup.c's tests. Probably worth adding a few simple tests to
pg_waldump itself.

In response to

  • Re: ubsan at 2022-03-23 20:12:34 from Andres Freund

Responses

  • Re: ubsan at 2022-03-23 23:02:30 from Tom Lane
  • Re: ubsan at 2022-03-25 15:55:45 from David Steele
  • Re: ubsan at 2022-03-26 01:33:41 from Andres Freund

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-03-23 22:57:04 Re: multithreaded zstd backup compression for client and server
Previous Message Thomas Munro 2022-03-23 22:54:15 Re: [PATCH] add relation and block-level filtering to pg_waldump