Handle contradictory relations combination as dead paths#1961
Handle contradictory relations combination as dead paths#1961karoliineh wants to merge 1 commit intomasterfrom
Conversation
|
It's interesting that this kind of contradiction only became apparent now. But that may be because most of our analyses don't have abstract states which would allow this to be determined, i.e. they can happily combine pretty much anything. The C2PO analysis seems to have something similar, but doesn't raise analyzer/src/analyses/c2poAnalysis.ml Lines 292 to 293 in 3bd3da1 @michael-schwarz, is it true that the C2PO analysis also infers relations between arguments and return value? If so, maybe it should also raise instead of just continuing with Bot.
|
|
@sim642: Yes, I think it does. The technique is called anchoring from some paper "Access-Based Localization for Octagons" by Beckschulze et al., and it was key to being able to not import a lot of imprecision from callees. |
This fixes one cause of the
IntDomain0.ArithmeticOnIntegerBotcrashes at SV-COMP, found by inspecting the analysis ofrecursive/recHanoi02-2.c.The crash was caused by propagating a bottom from
relationAnalysis.combine_env.In the failing recursive Hanoi case, context-insensitive summary reuse can legitimately pair a caller state with a callee summary whose constraints contradict the actual call arguments. The resulting bottom value is semantically correct and represents an infeasible path. However,
combine_envcontinued withunify_relbecoming bottom, propagating the bottom value further, eventually leading to theArithmeticOnIntegerBotcrash.The fix is to detect if
RD.is_bot_env unify_reland raiseDeadcodeimmediately, treating it as an unreachable path instead of propagating bottom. Why this is the right fix:During debugging, removing setting
relation.no-contextfor recursive functions from autotuning made the crash disappear, which helped isolate the issue, showing that the contradiction came from coarse summary reuse. But the real bug was the missing dead-path handling incombine_env, not the autotuning itself.With this fix, we should be now able to solve this task.