From 909160efe42ef1f2cb7f559e3cb5039a9680ca6c Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 15 Mar 2020 04:59:20 -0400 Subject: [errors] Print backtrace of internal errors in printers This is useful as witnessed by #11829 , as some errors printers do still fail, so it costs little to have both backtraces. --- lib/cErrors.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/cErrors.ml b/lib/cErrors.ml index d1548ab12e..62d465c703 100644 --- a/lib/cErrors.ml +++ b/lib/cErrors.ml @@ -106,8 +106,10 @@ let print_gen ~anomaly (e, info) = try print_gen ~anomaly ~extra_msg !handle_stack e with exn -> + let exn, info = Exninfo.capture exn in (* exception in error printer *) - str "" ++ fnl () ++ print_anomaly anomaly exn + str ":" ++ print_backtrace info ++ + str "