Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Ocamldebug quit with "Exception Not_found" when inspecting some variables #7830
Original bug ID: 7830
Ocamldebug sometimes quits launching an « Not_found » exception when trying to visualize some program variables. Here's a session example :
8<--------- START of EXAMPLE
$ ocamldebug -version
8<--------- END of EXAMPLE
The problem is not systematic and seems to depend on the variable to be printed (or at least on the module where it is defined). For example, setting a breakpoint in the Main (top-level) module is ok.This makes isolating a minimum triggering program difficult.
I therefore give a pointer to a publicly available program on which it shows and a sequence of step to reproduce it.
Steps to reproduce
This gives :
I did not try with 4.07.0 but since Ocamldebug is not mentioned in the Changelog i doubt this would make a difference (additionally, my program is bound to 4.06.0 because it must build under windows..)
Comment author: @nojb
TL;DR: seems to be a missing try ... with in ocamldebug's code when a .cmi cannot be found.
I run this on 4.07 and got the following backtrace for ocamldebug.
Raised at file "typing/env.ml", line 762, characters 18-27 Called from file "typing/env.ml", line 858, characters 13-47 Called from file "typing/env.ml", line 2044, characters 23-52 Called from file "typing/envaux.ml", line 66, characters 22-110 Called from file "typing/envaux.ml", line 64, characters 20-44 Called from file "typing/envaux.ml", line 45, characters 12-38 Called from file "typing/envaux.ml", line 43, characters 10-125 Called from file "typing/envaux.ml", line 41, characters 24-50 Called from file "typing/envaux.ml", line 40, characters 10-114 Called from file "command_line.ml", line 507, characters 7-76
Failure occurs when trying to open cmi of "Utils", which is a (packed) module of a library dependency (lascar).
Problem goes away adding the necessary include directory by hand, as in:
ocamldebug -I $(ocamlfind query lascar) rfsmc
Comment author: @nojb
ocamlc -g empty.ml main.ml