A valid VGM instruction can cause Valgrind to exit with an assertion failure like this: vex: priv/guest_s390_toIR.c:16378 (s390_irgen_VGM): Assertion `from <= to' failed. This assertion is incorrect. Instead, the reversed case `from > to' is valid and should result in a wrap-around mask.
Created attachment 159189 [details] Suggested fix for VGM
Created attachment 159191 [details] Enhance test coverage for VGM
The elfutils testsuite triggered this bug: https://inbox.sourceware.org/elfutils-devel/8e1dcc74187c46bc9fbad988b4f67ade0deaf872.camel@klomp.org/T/#m59e580471297164d345d4954e66490c3627958ff After applying this patch, the testsuite passed again.
I also backported this to the fedora valgrind package. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f4019f53e1
Note that the lfedora1 machine (now at Fedora 38) is showing this issue too now: https://sourceforge.net/p/valgrind/mailman/message/37865251/
The fix seems important, and it looks like the patches are doing their job, so I pushed them.