Sliced program computes value different from original (csmith)
ID0000781: **This issue was created automatically from Mantis Issue 781. Further discussion may take place here.** --- | **Id** | **Project** | **Category** | **View** | **Due Date** | **Updated** | | --- | --- | --- | --- | --- | --- | | ID0000781 | Frama-C | Plug-in > from | public | 2011-04-11 | 2014-02-12 | | | | | | | | | --- | --- | --- | --- | --- | --- | | **Reporter** | pascal | **Assigned To** | pascal | **Resolution** | fixed | | **Priority** | normal | **Severity** | minor | **Reproducibility** | have not tried | | **Platform** | - | **OS** | - | **OS Version** | - | | **Product Version** | Frama-C GIT, precise the release id | **Target Version** | - | **Fixed in Version** | Frama-C Nitrogen-20111001 | ### Description : The program does not contain undefined behaviors in the sense of the value analysis, as checked by ~/ppc/bin/toplevel.opt -val -slevel 5000 -cpp-command "gcc -C -E -I runtime " s.11114014.1.c -no-results -machdep x86_64 But, when compiling and executing the sliced program, the number displayed is different from the number displayed by the original program. cuoq@ns61143:~/csmith-2.0.0$ gcc -I runtime s.11114014.1.c -o s1 s.11114014.1.c: In function ‘func_59’: s.11114014.1.c:448: warning: comparison of distinct pointer types lacks a cast s.11114014.1.c: In function ‘func_93’: s.11114014.1.c:895: warning: large integer implicitly truncated to unsigned type cuoq@ns61143:~/csmith-2.0.0$ ./s1 [value] Called Frama_C_show_each({3932636802; }) cuoq@ns61143:~/csmith-2.0.0$ gcc -I runtime s.11114014.1.s.c -o s2 cuoq@ns61143:~/csmith-2.0.0$ ./s2 [value] Called Frama_C_show_each({1079028560; }) The sliced program was obtained using 12793+patch from bug report 780, with the command: ~/ppc/bin/toplevel.opt -val-signed-overflow-alarms s.11114014.1.c -cpp-command "gcc -C -E -I. -I runtime " -machdep x86_64 -slice-calls printf -slevel 5000 -slevel-function crc32_gentab:0 -then-on 'Slicing export' -no-slice-force -no-val -print -ocode s...s.c ### Additional Information : I am in a good position to know that these big random programs can be a pain to debug. It is possible to wait for a smaller problematic program to come along. I have quite thoroughly tested the value analysis on these random generated programs earlier. I would have liked to be more progressive and now check building blocks of the slicing, but I do not know what to use as oracle then. Only the slicing at the top of the pyramid offers a testable interface again. Take it easy, it's only random programs. I should replace the variadic printf by something less variadic, just in case. ## Attachments - [incorrect_sliced_value.tgz](/uploads/55d0b17bc0d91c4f9fecc25249a823a2/incorrect_sliced_value.tgz) - [small.tgz](/uploads/676e7c3158470fce017d924036662d7a/small.tgz)
issue