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

Open
vicuna opened this Issue Feb 8, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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" > a.ml
printf "let f n = print_int (Lazy.force n)" > p.ml
ocamlc -g a.ml
ocamlc -c p.ml
ocamldebug ./a.out <<EOF
load_printer p.cmo
install_printer P.f
break @ "a" # 21
run
print n
EOF

@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.