C2: Robust Node::uncast_helper infinite loop check

XMLWordPrintable

    • b03

      Current check in Node::uncast_helper checks for "infinite loop", but really checks for the depth of 1024 nodes when searching through the graph:
          assert(depth_count++ < K, "infinite loop in Node::uncast_helper");

      I suppose it is plausible to have a legit chain of 1K nodes with very deep inlining and/or optimization, which is _not_ an infinite loop. (This might be the cause for some CTW failures in deeper stress modes, checking it now.)

      Given how we basically walk through in(1), I think we can check against the number of nodes we have. If we walk more nodes than we have, that would mean we visited some node twice, which necessarily means there is a infinite loop in this walk. This makes the check more robust.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: