Two Machines, One Recursion Limit
This DFS runs over a 200,000-node path graph. Both machines are 64-bit with an 8 MiB thread stack, and the input is identical.
import sys
sys.setrecursionlimit(300000)
def dfs(u):
seen[u] = True
for v in adj[u]:
if not seen[v]:
dfs(v)
On CPython 3.10 the process dies with a segmentation fault. On CPython 3.13 it finishes. What accounts for the difference?
Sign in to answer questions and track your progress
Sign In