Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nondeterminism in integration test double-read-modf on Windows #129

Open
PeterMatula opened this issue Jan 30, 2018 · 2 comments
Open

Nondeterminism in integration test double-read-modf on Windows #129

PeterMatula opened this issue Jan 30, 2018 · 2 comments

Comments

@PeterMatula
Copy link
Collaborator

PeterMatula commented Jan 30, 2018

Regression test double-read-modf on Windows sometimes fails on:

Test (double-read-modf.c -a pic32 -f elf -c gcc -C -O0 -g)

AssertionError: compilation of file 'regression-tests\integration\current\double-read-modf\outputs\Test (double-read-modf.c -a pic32 -f elf -c gcc -C -O0 -g)\double-read-modf.out.c' failed with return code 1; output:
regression-tests\integration\current\double-read-modf\outputs\Test (double-read-modf.c -a pic32 -f elf -c gcc -C -O0 -g)\double-read-modf.out.c: In function 'func':
regression-tests\integration\current\double-read-modf\outputs\Test (double-read-modf.c -a pic32 -f elf -c gcc -C -O0 -g)\double-read-modf.out.c:27:5: warning: implicit declaration of function 'fpmodf' [-Wimplicit-function-declaration]
     fpmodf((int32_t)x, (int32_t)&intPart);
     ^~~~~~
double-read-modf.out.c:(.text+0x2d): undefined reference to `fpmodf'

Looks like fpmodf() is sometimes generated instead of modff().

@PeterMatula PeterMatula changed the title Nondeterminism in RetDec Nondeterminism in integration test double-read-modf on Windows Jan 30, 2018
@PeterMatula
Copy link
Collaborator Author

Another possible case in integration/strlen/2017-11-14/strlen.x86.gcc.O0.g.exe - run multiple times on the same Linux system.

@s3rvac
Copy link
Member

s3rvac commented May 26, 2018

I think the reason is that both modff and fpmodf have the same value (2634040448) and retdec-bin2llvmir fails to compare them in a deterministic way, so sometimes fpmodf is generated instead of modff:

$ retdec-fileinfo double-read-modf.pic32.gcc.O0.g.elf -v | grep 2634040448
1497  modff    DATA OBJECT  GLOBAL   Default visibility   92   2634040448 0
2987  fpmodf   DATA OBJECT  GLOBAL   Default visibility   92   2634040448 0

@PeterMatula, shouldn't this be solved by the changes in #116? IIRC we have discussed this some time ago.

@PeterMatula PeterMatula self-assigned this Sep 16, 2019
@PeterMatula PeterMatula added this to the RetDec v4 milestone Sep 16, 2019
@PeterMatula PeterMatula modified the milestones: RetDec v4, RetDec v4+ Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants