DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

automatically check for floating-point instrs in DR code at build time #468

Open derekbruening opened 9 years ago

derekbruening commented 9 years ago

From bruen...@google.com on May 26, 2011 11:44:18

xref issue #386 DynamoRIO assumes that its code does not affect floating-point state. In the past we've had cases where cl (the VS compiler) will use floating-point instructions where we don't expect them ( issue #386 ). I don't think there's any flag or pragma to prevent this, but at the least we'd like to detect it.

"dumpbin /disasm" produces a bunch of non-code disassembly so it requires some manual examination to decide what apparent fp instrs are really data or padding between functions. I was using scripts to grep for opcodes starting with f and manually examining the results. to automate we'd want to query symbols and disassemble down to the ret (assuming there's only one and it's at the end) and assume the rest of the bytes still labeled as that symbol are padding.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=468

derekbruening commented 9 years ago

From qin.zhao@gmail.com on May 26, 2011 09:03:24

You have to check not only DR but also client and libraries they depend on. And not only once statically, but also every time when you run the program with DR and its' client. Not sure if we can do it.

derekbruening commented 9 years ago

From bruen...@google.com on May 26, 2011 09:08:20

you're expanding the scope of the issue as I filed it. this issue covers adding a build-time step that tries to find any new floating-point instrs in dynamorio.dll that are not in routines wrapped in fp state preservation code. it's not trying to do anything more than that.

Summary: automatically check for floating-point instrs in DR code at build time