Bug 470132 - s390x: Assertion failure on VGM instruction
Summary: s390x: Assertion failure on VGM instruction
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Arnez
Depends on:
Reported: 2023-05-22 15:57 UTC by Andreas Arnez
Modified: 2023-07-06 17:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

Suggested fix for VGM (2.67 KB, patch)
2023-05-22 18:20 UTC, Andreas Arnez
Enhance test coverage for VGM (3.66 KB, patch)
2023-05-22 18:26 UTC, Andreas Arnez

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Arnez 2023-05-22 15:57:17 UTC
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.
Comment 1 Andreas Arnez 2023-05-22 18:20:50 UTC
Created attachment 159189 [details]
Suggested fix for VGM
Comment 2 Andreas Arnez 2023-05-22 18:26:17 UTC
Created attachment 159191 [details]
Enhance test coverage for VGM
Comment 3 Mark Wielaard 2023-06-17 16:52:24 UTC
The elfutils testsuite triggered this bug:

After applying this patch, the testsuite passed again.
Comment 4 Mark Wielaard 2023-06-28 14:40:34 UTC
I also backported this to the fedora valgrind package.
Comment 5 Mark Wielaard 2023-07-03 08:53:20 UTC
Note that the lfedora1 machine (now at Fedora 38) is showing this issue too now:
Comment 6 Andreas Arnez 2023-07-06 17:10:36 UTC
The fix seems important, and it looks like the patches are doing their job, so I pushed them.