Re: valgrind issues on Fedora 28

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: valgrind issues on Fedora 28
Date: 2018-11-06 17:35:00
Message-ID: 20181106173500.ojw6btsxy3oj5jwz@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-11-06 18:24:55 +0100, Tomas Vondra wrote:
> I've recently updated to Fedora 28, and in that environment I get quite a
> few new valgrind issues (see the attached log).
>
> Essentially, all the reports start with either
>
> ==5971== Invalid read of size 32
> ==5971== at 0x5957EB1: __wcsnlen_avx2 (in /usr/lib64/libc-2.27.so)
> ==5971== by 0x589E871: wcsrtombs (in /usr/lib64/libc-2.27.so)
> ==5971== by 0x5834000: wcstombs (in /usr/lib64/libc-2.27.so)
> ==5971== by 0x97DD82: wchar2char (pg_locale.c:1641)

I think this isn't actually a bug, just a missing suppression. The avx2
code uses instructions to scan for 0 bytes in multiple bytes at the same
time. Therefore it can encounter a byte marked as undefined, even if it
never actually uses that value.

> or
>
> ==5971== Conditional jump or move depends on uninitialised value(s)
> ==5971== at 0x5822123: __gconv_transform_internal_utf8 (in
> /usr/lib64/libc-2.27.so)
> ==5971== by 0x589E8A4: wcsrtombs (in /usr/lib64/libc-2.27.so)
> ==5971== by 0x5834000: wcstombs (in /usr/lib64/libc-2.27.so)
> ==5971== by 0x97DD82: wchar2char (pg_locale.c:1641)
>
> or some other combination of that. In all cases the call stack is
>
> wchar2char > wcstombs > wcsrtombs > something

I think I came to the same conclusion here, but I'm not quite sure.

FWIW, I've supressed these on my valgrind animal a while ago.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-06 17:35:27 Re: valgrind issues on Fedora 28
Previous Message Alvaro Herrera 2018-11-06 17:32:10 Re: New Defects reported by Coverity Scan for PostgreSQL