Stream: git-wasmtime

Topic: wasmtime / issue #3258 cranelift: Prevent infinite loops ...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2021 at 18:11):

sunfishcode commented on issue #3258:

This fixes the case of a block branching back to itself, but this code will still infinite loop if it walks into a cycle containing multiple blocks and the entire cycle is unreachable from the entry block.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2021 at 10:32):

afonso360 commented on issue #3258:

That's true! And running the fuzzer again with this fix found a example of the situation that you were mentioning.

I've change the approach somewhat, we now do a sort of graph search over predecessors. It is not a full search over all blocks, because we stop searching once we find a block with multiple predecessors. This avoids the situation where we have to visit all blocks in the function for every non local var lookup, which should help a lot with performance.

The original algorithm can deal with these cases where we have multiple predecessors somewhere down the line of predecessors.

I've run the fuzzer on this for the last 2 hours, and it seems to be working as intended.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2021 at 10:37):

afonso360 edited a comment on issue #3258:

That's true! And running the fuzzer again with this fix found a example of the situation that you were mentioning.

I've change the approach somewhat, we now do a sort of graph search over predecessors. It is not a full search over all blocks, because we stop searching once we find a block with multiple predecessors. This avoids the situation where we have to visit all blocks in the function for every non local var lookup, which should help a lot with performance.

The original algorithm can deal with these cases where we have multiple predecessors somewhere down the line of predecessors.

I've run the fuzzer on this for the last 2 hours, and it seems to be working as intended. (The other examples were usually found within 5 min)


Last updated: Oct 23 2024 at 20:03 UTC