https://bugs.kde.org/show_bug.cgi?id=383010

--- Comment #107 from Michał Dec <moog...@gmail.com> ---
(In reply to Mark Wielaard from comment #103)
> Normally glibc uses ifuncs which check whether avx512 is available. Since
> valgrind doesn't advertise avx512 being available glibc should normally not
> use it. Do you know why it does? How is your glibc build? What error do you
> see under valgrind?

> Do you know why it does?

I don't know, that's why I'm asking. From what I understand in my next answer,
I should disable multiarch and recompile glibc without AVX-512. But I don't
wanna reboot for nothing. I have an AM5 system and I really hate rebooting it,
it takes forever.

> How is your glibc build?

At the time of writing, this is the recipe for building the version of glibc
considered stable on amd64:
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-2.39-r6.ebuild?id=9adf7dbf124f3810b77c28a04f7dd7995d238854
The flags I have enabled in my build are pretty common ones: cet multiarch ssp
stack-realign

> What error do you see under valgrind?

```
vex amd64->IR: unhandled instruction bytes: 0x62 0xD2 0xFD 0x28 0x7C 0xC0 0x48
0x89 0xC6 0x31
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==28914== valgrind: Unrecognised instruction at address 0x484f0cf.
==28914==    at 0x484F0CF: memset (vg_replace_strmem.c:1390)
==28914==    by 0x4A47F71: memset (string_fortified.h:59)
==28914==    by 0x4A47F71: CRYPTO_zalloc (mem.c:224)
==28914==    by 0x4A5A220: CRYPTO_THREAD_lock_new (threads_pthread.c:684)
==28914==    by 0x4B330FC: do_rand_init (rand_lib.c:51)
==28914==    by 0x4B330FC: do_rand_init_ossl_ (rand_lib.c:48)
==28914==    by 0x4DE340F: __pthread_once_slow (pthread_once.c:116)
==28914==    by 0x4DE3526: pthread_once@@GLIBC_2.34 (pthread_once.c:143)
==28914==    by 0x4A5A31C: CRYPTO_THREAD_run_once (threads_pthread.c:786)
==28914==    by 0x4B33B4C: RAND_get_rand_method (rand_lib.c:190)
==28914==    by 0x4B347DC: RAND_bytes_ex (rand_lib.c:368)
==28914==    by 0x10996B: (a function that calls RAND_bytes) (src.c:191)
==28914==    by 0x109427: main (src.c:516)
```

I've ran this program through valgrind on a machine that doesn't have AVX-512,
and it runs fine. No leaks, not even a single complaint about uninitialized
variables being read.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to