Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldebug hangs or crashes on printing lazy values with custom printer #7914

vicuna opened this Issue Feb 8, 2019 · 0 comments


None yet
2 participants
Copy link

vicuna commented Feb 8, 2019

Original bug ID: 7914
Reporter: herbelin
Status: new
Resolution: open
Priority: normal
Severity: crash
Version: 4.06.1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @nojb @gasche @diml

Bug description

#6684 was about printing a lazy value in ocamldebug with the generic printer.
It was fixed and this was very helpful. There is however a similar problem when trying to print lazy values with a custom printer. It either crashes with:

Fatal error: exception End_of_file
Segmentation fault

or hangs (presumably on an input_value trying to fetch the lazy value, though not fully sure on the diagnostic).

The same actually happens when printing functions with a custom printer (though the need is probably less common).

I feel a bit powerless to help more.

Steps to reproduce

printf "let n = lazy (1+1) in n" >
printf "let f n = print_int (Lazy.force n)" >
ocamlc -g
ocamlc -c
ocamldebug ./a.out <<EOF
load_printer p.cmo
install_printer P.f
break @ "a" # 21
print n

@vicuna vicuna added the tools label Mar 14, 2019

@nojb nojb added ocamldebug and removed ocamldebug labels Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.