I may be imagining things, but I feel like the quality of OCaml backtraces has recently deteriorated. Here is an example to illustrate my point:
Uncaught exception: Not_found Raised at file "src/import0.ml" (inlined), line 234, characters 22-32 Called from file "src/exn.ml", line 70, characters 6-15 Called from file "bin/dump/dump.ml", line 159, characters 4-642
Here is the code in “bin/dump/dump.ml”, line 159:
Out_channel.with_file (dir ^ "/results.log") ~f:(fun log -> List.iter max_failures ~f:(fun max_failures -> List.iter failure_probs ~f:(fun failure_prob -> printf "\n%s, Pr[failure] = %s, max failures = %d\n" (Filename.basename base_name) (Prob.to_string failure_prob) max_failures; printf "================================================================\n"; analyze base_name ~max_failures ~failure_prob ~log |> List.iter ~f:(dump_data ~dir); printf "\n"; ) ) )
The backtrace is obviously completely useless.
Any ideas why the backtrace may be so useless and what I might do to get better backtraces? I tried the
-inline 0 flags, but with no success. I’m using