Expected behavior
A cyclic template instantiation should be rejected with a clean diagnostic that names
the cycle (e.g., template instantiation cycle: A -> B -> A), not abort the process.
The bug
Two templates that instantiate each other recurse until the OS thread stack is
exhausted; the compiler aborts with a fatal runtime error: stack overflow (exit code
134) and no source location or template name.
template A() { component b = B(); }
template B() { component a = A(); }
component main = A();
thread 'main' has overflowed its stack
fatal runtime error: stack overflow, aborting
circom exit status: 134
Expected behavior
A cyclic template instantiation should be rejected with a clean diagnostic that names
the cycle (e.g.,
template instantiation cycle: A -> B -> A), not abort the process.The bug
Two templates that instantiate each other recurse until the OS thread stack is
exhausted; the compiler aborts with a
fatal runtime error: stack overflow(exit code134) and no source location or template name.