riboseinc / retrace

retrace is a versatile security vulnerability / bug discovery tool through monitoring and modifying the behavior of compiled binaries on Linux, OpenBSD/FreeBSD/NetBSD (shared object) and macOS (dynamic library).
Other
60 stars 19 forks source link

printf prints the wrong number for floats #391

Open pablo-mendoza opened 5 years ago

pablo-mendoza commented 5 years ago

This program:

#include <stdio.h>
int main(void)
{
        printf ("%.0f %d\n", 1.0, 1);
}

will print "1 1" when run on its own, but when run under retrace v2 would print "0 1"

ronaldtse commented 5 years ago

@riataman good find -- can we add a test for this?

pablo-mendoza commented 5 years ago

I need to revamp the tests, I don't think we are running any tests for v2 right now.