uwplse / herbgrind

A Valgrind tool for Herbie
GNU General Public License v3.0
90 stars 7 forks source link

Execution issue #49

Closed hbrunie closed 4 years ago

hbrunie commented 4 years ago

Running Herbgrind on a scientific application (python, C++, using boost), I obtained an assertion error: instrument/floattypes.c:1285 Cannot meet types Vt_Double and Vt_NonFloat

I don't know why it was thrown, and how could I correct it in my code. Thank you,

image
hbrunie commented 4 years ago

Here is the stack as shown by valgrind(herbgrind tool) when it fails on the assertion:

image
HazardousPeach commented 4 years ago

That error is due to Herbgrind finding an unsafe type conversion when trying to infer the types of values in the assembly code. In this case, judging by your backtrace, it's because of the libm implementation of exp2l, which does integer-like bit manipulation in order to implement the exp2 function. Normally, these kinds of libm tricks aren't a problem, because the calls into libm are intercepted and dealt with seperately, so there's no need to instrument that assembly. Unfortunately, we forgot to add exp2l to our list of functions to wrap, so you hit this issue. This omission is fixed in a98afab.

hbrunie commented 4 years ago

Thank you for the complete and precise answer.