How to find out which function causes Exception “Stack_overflow” in OCaml
Posted on In QAMy OCaml program prints:
Fetal error: Exception "Stack_overflow"
without any further information.
How to find out which function causes this “Stack_overflow” exception?
First, recompile your OCaml program with -g
.
Second, rerun your OCaml program with OCAMLRUNPARAM=b
and the backtrace will be printed out after the “Stack_overflow” exception.