Re: suspicious valgrind reports about radixtree/tidstore on arm64

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, John Naylor <johncnaylorls(at)gmail(dot)com>
Subject: Re: suspicious valgrind reports about radixtree/tidstore on arm64
Date: 2024-06-19 23:51:52
Message-ID: 248275.1718841112@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I hypothesize that the reason we're not seeing equivalent failures
> on x86_64 is one of

> 1. x86_64 valgrind is stupider than aarch64, and fails to track that
> the contents of the SIMD registers are only partially defined.

> 2. x86_64 valgrind is smarter than aarch64, and is able to see
> that the "mask off invalid entries" step removes all the
> potentially-uninitialized bits.

Hah: it's the second case. If I patch radixtree.h as attached,
then x86_64 valgrind complains about

==00:00:00:32.759 247596== Conditional jump or move depends on uninitialised value(s)
==00:00:00:32.759 247596== at 0x52F668: local_ts_node_16_search_eq (radixtree.h:1018)

showing that it knows that the result of vector8_highbit_mask is
only partly defined. Kind of odd though that aarch64 valgrind
is getting the hard part right and not the easy(?) part.

regards, tom lane

Attachment Content-Type Size
make-radixtree-failure-visible-on-x86_64.patch text/x-diff 900 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-06-20 00:46:30 Re: Pluggable cumulative statistics
Previous Message Tom Lane 2024-06-19 23:33:21 Re: suspicious valgrind reports about radixtree/tidstore on arm64