Bug 470132 - s390x: Assertion failure on VGM instruction
Summary: s390x: Assertion failure on VGM instruction
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Arnez
URL:
Keywords:
Depends on:
Blocks:
 
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:


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

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:
https://inbox.sourceware.org/elfutils-devel/8e1dcc74187c46bc9fbad988b4f67ade0deaf872.camel@klomp.org/T/#m59e580471297164d345d4954e66490c3627958ff

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.
https://bodhi.fedoraproject.org/updates/FEDORA-2023-f4019f53e1
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:
https://sourceforge.net/p/valgrind/mailman/message/37865251/
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.