Bug 201152 - ppc32g_dirtyhelper_MFSPR_268_269 crashes valgrind on PPC64 systems
Summary: ppc32g_dirtyhelper_MFSPR_268_269 crashes valgrind on PPC64 systems
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.4.1
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-22 22:08 UTC by Joseph Jezak
Modified: 2015-04-26 17:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Jezak 2009-07-22 22:08:06 UTC
Version:           3.4.1 (using Devel)
Compiler:          gcc-4.1.2 
OS:                Linux
Installed from:    Compiled sources

On my Quad G5 using glibc-2.9 + gentoo patches and fixes, _start uses the instruction: 

mfspr %0, 268


When this is translated into VEX, the handler  "ppc32g_dirtyhelper_MFSPR_268_269" is added to the VEX stream. Unfortunately, the return value of this function is 32 bits. This results in a 32 bit write to a temporary register which isn't allowed by the assertion on line 940 of toIR.c.

Possbile solutions to this problem would be either allowing 32 bit register writes by removing this assertion or adapting the handler into a ppc64 specific version. If you let me know which you would prefer, I'd be happy to write a patch to fix this issue.
Comment 1 Florian Krohm 2015-04-26 17:40:50 UTC
This must have been fixed in the meantime. I don't see any assertion when pushing this through valgrind
int main()
{
   asm volatile ( "mfspr  8, 268");
   return 0;
}