|
From: Michael D. <mda...@bl...> - 2016-10-22 00:59:48
Attachments:
vex_amd64_aso.diff
|
Hello, When running Valgrind on amd64, I believe handleAddrOverrides() is incorrectly truncating the segment base addresses when the address-size override prefix is used. The way I stumbled upon this was having a value over the 4GB boundary in the fs register and hitting this instruction: 0x0000000000052105 <+5>: 64 67 8b 00 mov %fs:(%eax),%eax The final address is truncated, which ends up reading from the wrong location. Intel Developers Manual (Address Calculations in 64-Bit Mode) says that the base is added after the effective address is truncated, and that the base itself does not get truncated. The AMD64 Programmers Manual Vol2 says something similar. I have attached the patch I am currently using to work around it. Thanks, Mike |
|
From: Philippe W. <phi...@sk...> - 2016-10-22 15:58:59
|
Thanks for the analysis and the patch. To increase the chance to have this not forgotten, it is better to file a bug with this on bugzilla. Adding (or modifying an existing) test also increases the chances to have this fixed in svn. Thanks Philippe On Sat, 2016-10-22 at 00:59 +0000, Michael Daniels wrote: > Hello, > > When running Valgrind on amd64, I believe handleAddrOverrides() is > incorrectly truncating the segment base addresses when the address-size > override prefix is used. > > The way I stumbled upon this was having a value over the 4GB boundary > in the fs register and hitting this instruction: > > 0x0000000000052105 <+5>: 64 67 8b 00 mov %fs:(%eax),%eax > > The final address is truncated, which ends up reading from the wrong > location. > > Intel Developers Manual (Address Calculations in 64-Bit Mode) says that > the base is added after the effective address is truncated, and that > the base itself does not get truncated. The AMD64 Programmers Manual > Vol2 says something similar. > > I have attached the patch I am currently using to work around it. > > Thanks, > > Mike > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |