valgrind missing TM instructions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
valgrind (Ubuntu) |
Fix Released
|
Undecided
|
Matthias Klose |
Bug Description
valgrind fails on Ubuntu 15.10 Wily when debugging threaded applicatoins. The issue is the TM instructions in the pthread lock elision code:
dis_proc_
disInstr(ppc): unhandled instruction: 0x7D2322A6
==94927== valgrind: Unrecognised instruction at address 0x417f6e8.
==94927== at 0x417F6E8: __elide_lock (elide.h:52)
==94927== by 0x417F6E8: pthread_
==94927== by 0x10D65CDB: llvm::sys:
==94927== by 0x10A149B7: lock (RWMutex.h:119)
==94927== by 0x10A149B7: SmartScopedWriter (RWMutex.h:166)
==94927== by 0x10A149B7: llvm::PassRegis
==94927== by 0x10A13767: llvm::PassNameP
==94927== by 0x1040F54B: list<char [13], llvm::cl::desc, llvm::cl:
==94927== by 0x1040F54B: __static_
==94927== by 0x1040F54B: _GLOBAL_
==94927== by 0x12359D63: __libc_csu_init (in /home/anton/
==94927== by 0x450348B: generic_
==94927== by 0x4503733: (below main) (libc-start.c:94)
==94927== Your program just tried to execute an instruction that Valgrind
==94927== did not recognise. There are two possible reasons for this.
==94927== 1. Your program has a bug and erroneously jumped to a non-code
==94927== location. If you are running Memcheck and you just saw a
==94927== warning about a bad jump, it's probably your program's fault.
==94927== 2. The instruction is legitimate but Valgrind doesn't handle it,
==94927== i.e. it's Valgrind's fault. If you think this is the case or
==94927== you are not sure, please let us know and we'll try to fix it.
==94927== Either way, Valgrind will now raise a SIGILL signal which will
==94927== probably kill your program.
== Comment: #1 - Carl E. Love <email address hidden> - 2015-09-17 12:21:09 ==
Anton
The instruction hex code for the unhandled instruction is 7D2322A6. You say it is a Transactional Memory instruction (TM). The format of the TM instructions has a primary opcode of 31, which matches your instruction.
The secondary instruction identifier for the TM instruction is in bits 21:30 which for you instruction is 0x153 = 339 decimal, assuming I didn't screw it up.
Looking at the Power ISA v2.07 I find the following TM instructions and corresponding secondary identifiers:
tbegin. 654
tend. 686
tabort. 910
tabortwc. 782
tabortwci. 846
tabortdci. 878
tsr. 750
tcheck 718
I am not seeing a TM instruction with a secondary identifier of 339.
I did find the move instruction mfspr RT,SPR which has a primary opcode of 31 and a secondary opcode of 339. The spr number is in bits 11:20 which is 0x245 = 581 decimal. Figure 17 in the ISA 2.07, page 881 does not list an SPR of 581.
The registers used with the TM instructions and spr numbers are:
TFHAR 128
TFIAR 129
TEXASR 130
TEXASRU 121
So, this doesn't seem to match either.
Can you send me the assembly code for the instruction so I can figure out which TM instruction it is? Thanks for the help.
== Comment: #3 - William M. Schmidt <email address hidden> - 2015-09-18 16:20:56 ==
valgrind svn revision 3143.
== Comment: #4 - William M. Schmidt <email address hidden> - 2015-09-18 16:22:06 ==
(I meant to add this comment before the attachment).
(In reply to comment #0)
> valgrind fails on Ubuntu 15.10 Wily when debugging threaded applicatoins.
> The issue is the TM instructions in the pthread lock elision code:
>
> dis_proc_
> disInstr(ppc): unhandled instruction: 0x7D2322A6
> primary 31(0x1F), secondary 678(0x2A6)
That message comes out of the default case when handling the mfspr register number.
looks like valgrind in Wily is missing this patch:
r3143 | carll | 2015-04-22 11:15:41 -0500 (Wed, 22 Apr 2015) | 16 lines
Add support for the TEXASRU register.
tags: |
added: targetmilestone-inin1510 removed: targetmilestone-inin--- |
Default Comment by Bridge