-
Notifications
You must be signed in to change notification settings - Fork 170
__builtin_unreachable() in LDV benchmarks #1296
Comments
Is this actually reachable in the code? If not, there is no problem, right? I had a look at a few calls of those calls, and all where cases where in the original Linux code the macro |
It might very well be true that all such locations are unreachable, but as is, nothing about the benchmarks is requiring a verifier to prove that they are actually unreachable. Interpreting abstractly, such location might be reachable, but since it's not necessarily a violation of the reachability property being checked, it's not an abstract counterexample that needs to be refined. Rather, one might just want to soundly and abstractly interpret it. On the other hand, if the checked property were proving the lack of undefined behavior, it would require a verifier to prove unreachability. To ensure that all these locations are unreachable, one would have to construct alternate version of these benchmarks where |
Actually in ldv-linux-3.14-races/linux-3.14--drivers--net--irda--nsc-ircc.ko.cil.i seems reachable as well, although likely only due to LDV modelling. There sv-benchmarks/c/ldv-linux-3.14-races/linux-3.14--drivers--net--irda--nsc-ircc.ko.cil.i Lines 5875 to 5888 in 99d37c5
The discriminating value sv-benchmarks/c/ldv-linux-3.14-races/linux-3.14--drivers--net--irda--nsc-ircc.ko.cil.i Line 5821 in 99d37c5
Arguably the problem in this benchmark might be the Ok, there's another sv-benchmarks/c/ldv-linux-3.14-races/linux-3.14--drivers--net--irda--nsc-ircc.ko.cil.i Line 6022 in 99d37c5
whose unknown function pointer also ends up being called sv-benchmarks/c/ldv-linux-3.14-races/linux-3.14--drivers--net--irda--nsc-ircc.ko.cil.i Lines 6139 to 6146 in 99d37c5
which is a bigger problem anyway. |
The function
__builtin_unreachable()
is called in many LDV benchmarks: https://github.com/sosy-lab/sv-benchmarks/search?p=17&q=__builtin_unreachable. However, the function is nowhere defined or even declared.Clearly this is supposed to be a GCC builtin: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable. Unfortunately this by definition invokes undefined behavior directly:
I suppose the most reasonable well-defined behavior for its analysis would be to assume execution doesn't continue at that point. I think it would be better to make it explicit in the programs themselves. In the spirit of what's already there,
assume_abort_if_not(0);
should be a good replacement.The text was updated successfully, but these errors were encountered: