Bug 1306844
Summary: | valgrind on s390x fails to handle "popcnt" instruction (0xb9e1) | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Dave Malcolm <dmalcolm> | ||||
Component: | valgrind | Assignee: | Mark Wielaard <mjw> | ||||
Status: | CLOSED ERRATA | QA Contact: | Miloš Prchlík <mprchlik> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 7.1 | CC: | jakub, mbenitez, mcermak, mprchlik, ohudlick | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | s390x | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | valgrind-3.11.0-20.el7 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-11-04 02:55:56 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Dave Malcolm
2016-02-11 21:20:02 UTC
(In reply to Dave Malcolm from comment #0) [...] > Steps to Reproduce: > A more minimal reproducer: > $ cat popcnt.c > > int main (int argc, const char **argv) > { > return __builtin_popcountl ((long)argc); > } FWIW the cast to long is redundant; the reproducer triggers the bug equally well without it. [...] objdump -d a.out shows: [...snip...] 0000000080000540 <main>: 80000540: eb bf f0 58 00 24 stmg %r11,%r15,88(%r15) 80000546: e3 f0 ff 50 ff 71 lay %r15,-176(%r15) 8000054c: b9 04 00 bf lgr %r11,%r15 80000550: b9 04 00 12 lgr %r1,%r2 80000554: e3 30 b0 a0 00 24 stg %r3,160(%r11) 8000055a: 50 10 b0 ac st %r1,172(%r11) 8000055e: e3 10 b0 ac 00 14 lgf %r1,172(%r11) 80000564: b9 e1 00 11 popcnt %r1,%r1 80000568: eb 21 00 20 00 0d sllg %r2,%r1,32 8000056e: b9 08 00 12 agr %r1,%r2 80000572: eb 21 00 10 00 0d sllg %r2,%r1,16 80000578: b9 08 00 12 agr %r1,%r2 8000057c: eb 21 00 08 00 0d sllg %r2,%r1,8 80000582: b9 08 00 12 agr %r1,%r2 80000586: eb 11 00 38 00 0c srlg %r1,%r1,56 8000058c: b9 14 00 11 lgfr %r1,%r1 80000590: b9 04 00 21 lgr %r2,%r1 80000594: e3 40 b1 20 00 04 lg %r4,288(%r11) 8000059a: eb bf b1 08 00 04 lmg %r11,%r15,264(%r11) 800005a0: 07 f4 br %r4 800005a2: 07 07 nopr %r7 800005a4: 07 07 nopr %r7 800005a6: 07 07 nopr %r7 [...snip...] Created attachment 1123300 [details]
Patch (to gcc) to hack out usage of __builtin_popcountl
Note to self: here's the crude workaround patch I applied to my code (gcc) to avoid using __builtin_popcountl, enabling valgrind to run enough to see the bug I was actually trying to track down.
Confirmed. Replicated with latest valgrind and filed upstream: https://bugs.kde.org/show_bug.cgi?id=359289 Patch upstream (VEX svn r3210) and in fedora (valgrind-3.11.0-13.fc24) Verified for build valgrind-3.11.0-22.el7. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-2297.html |