Summary: | Unexpected behaviour with IR injection and vex-guest-chase=yes | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Florian Krohm <flo2030> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | tarball with reproducer and patch |
Description
Florian Krohm
2025-07-01 18:58:43 UTC
Valgrind's behaviour is not incorrect as originally stated. It was just unexpected because I had falsely believed that chasing (which is enabled by default) would stop at conditional branches. Chasing into VALGRIND_VEX_INJECT_IR causes vex_inject_ir to be invoked which will add IRStmt(s) to the current super block. And we don't want that to happen speculatively. The remedy would be to teach function chase_into_ok to not chase into VALGRIND_VEX_INJECT_IR. But that is not so easy. We would have to recognise, on all platforms, the "special opcode preamble" which, in general, is several bytes long. And we do not really know whether those bytes are all accessible. Perhaps there is a way.... To me the effort seems not warranted because IR injection is currently only used for testing purposes. Hence, not performance critical. Therefore, the workaround is to use --vex-guest-chase=no on the command line when doing IR injection. Fixed in 0329ab2021727242f31adfd665f602a8a6163aa8 |