Bug 353680 - s390x: Crash with certain glibc versions due to non-implemented TBEGIN
Summary: s390x: Crash with certain glibc versions due to non-implemented TBEGIN
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.10 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-08 09:00 UTC by Andreas Arnez
Modified: 2015-10-12 20:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Mask off unsupported features from HWCAP (3.09 KB, patch)
2015-10-08 09:24 UTC, Andreas Arnez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Arnez 2015-10-08 09:00:31 UTC
When running a program under Valgrind on a zEC12 or z13 whose glibc has lock elision enabled, the glibc infers from HWCAP that the prerequisites for lock elision are met.  Then it may use TBEGIN, which is not implemented by Valgrind.
The failure can be reproduced with drd/tests/atomic_var from the Valgrind test suite:
  vex s390->IR: unimplemented insn: E560 0000 FF0C
  valgrind: Unrecognised instruction at address 0x.........
     at 0x........: (within libpthread-?.?.so)
     by 0x........: ???
A similar problem may occur with the upcoming glibc release 2.23, since it will optimize various string functions with vector instructions on z13 when available. See: https://sourceware.org/ml/libc-alpha/2015-07/msg00077.html

One way of fixing this would be to implement the missing instructions in Valgrind: the transactional-execution- and all vector instructions. Another way is to mask off unsupported/unknown hardware features from HWCAP. The latter approach should also help for any future unsupported hardware features.

Reproducible: Always
Comment 1 Andreas Arnez 2015-10-08 09:24:48 UTC
Created attachment 94888 [details]
Mask off unsupported features from HWCAP
Comment 2 Florian Krohm 2015-10-12 20:36:21 UTC
Thanks for the patch. Applied as r15702.