[pcre-dev] [Bug 2540] Valgrind errors in PCRE2 JIT code

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2540] Valgrind errors in PCRE2 JIT code
https://bugs.exim.org/show_bug.cgi?id=2540

--- Comment #4 from Vesselin Atanasov <vesselin@???> ---
Zoltan Herczeg, thank you for the suggestion. I checked the pcre2 source RPM
and it seems to compile pcre2 with "--disable-valgrind".

I am not very experienced with pcre2, but from what I read in the pcre2
documentation, "--enable-valgrind" actually tells Valgrind that some areas are
not readable, so it may actually detect more errors. So "--enable-valgrind"
should not suppress existing errors. Is that correct or am I missing some
detail(s)?

Regarding the actual error "Invalid read..." - in my case PCRE2 is compiled
with SIMD indeed. So if this kind of Valgrind errors are expected, then I am
not too worried about it.

However, I am curious and I would appreciate if you can clarify a bit your
previous message. You said "Reading aligned memory is always working regardless
of the actual buffer start or end, and this is exploited by JIT."

Do you mean that this kind of reads past the end of the buffer is expected from
PCRE2+SIMD JIT ?

Also do you mean that the x86_64 architecture guarantees that aligned reads
will not cause any kind of exception even if the read is past the end of the
buffer? Or did you actually mean something else and I misunderstood you?

Thank you in advance!

(In reply to Zoltan Herczeg from comment #2)
> Did you compiled pcre with --enable-valgrind? This disables x86 simd
> optimizations. Reading aligned memory is always working regardless of the
> actual buffer start or end, and this is exploited by JIT.


--
You are receiving this mail because:
You are on the CC list for the bug.