Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005836OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2012-11-21 10:102014-12-13 16:35
Reporterpboutill 
Assigned Toxclerc 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86_64OSMacOSOS Version10.8
Product Version4.00.1 
Target Version4.02.2+devFixed in Version4.03.0+dev 
Summary0005836: Printing forced lazy value in ocamldebug
DescriptionOcamldebug segfault when you try to print a forced lazy value. It is because of a marshall error.
I do not exept it to print the value but I would enjoy if i could say "<lazy>" instead of segfault.
This way I won't loose my debugging session because I forgot that there are lazy stuff in the record I want to print ...
Steps To Reproduce$ echo "let k = Lazy.from_fun (fun () -> 1) in" > ex.ml
$ echo "print_int (Lazy.force k)" >> ex.ml
$ ocamlc -g -o ex ex.ml
$ ocamldebug ./ex
    OCaml Debugger version 4.00.1

(ocd) break @ Ex 2
Loading program... done.
Breakpoint 1 at 8572 : file ex.ml, line 1, characters 9-36
(ocd) r
Time : 15 - pc : 8576 - module Ex
Breakpoint : 1
2 <|b|>print_int (Lazy.force k)
(ocd) p k
k : int Lazy.t = <lazy>
(ocd) s
Time : 16 - pc : 7804 - module CamlinternalLazy
24 <|b|>let closure = (Obj.obj (Obj.field (Obj.repr blk) 0) : unit -> 'arg) in
(ocd)
Time : 17 - pc : 7824 - module CamlinternalLazy
25 <|b|>Obj.set_field (Obj.repr blk) 0 raise_undefined;
(ocd)
Time : 18 - pc : 7840 - module CamlinternalLazy
26 <|b|>try
(ocd)
Time : 19 - pc : 8532 - module Ex
1 let k = Lazy.from_fun (fun () -> <|b|>1) in
(ocd)
Time : 20 - pc : 7864 - module CamlinternalLazy
28 <|b|>Obj.set_field (Obj.repr blk) 0 (Obj.repr result); (* do set_field BEFORE set_tag *)
(ocd)
Time : 21 - pc : 7884 - module CamlinternalLazy
29 <|b|>Obj.set_tag (Obj.repr blk) Obj.forward_tag;
(ocd)
Time : 22 - pc : 7908 - module CamlinternalLazy
29 Obj.set_tag (Obj.repr blk) Obj.forward_tag<|a|>;
(ocd)
Time : 23 - pc : 8676 - module Ex
2 print_int (Lazy.force k)<|a|>
(ocd) p k
Fatal error: exception End_of_file
Segmentation fault: 11
Additional InformationSame behavior under debian amd64 3.12(.1)
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0006684resolvedgasche Printing lazy value segfaults ocamldebug 

-  Notes
(0012792)
gasche (developer)
2014-12-13 16:35

Fixed in trunk.

- Issue History
Date Modified Username Field Change
2012-11-21 10:10 pboutill New Issue
2012-11-21 14:11 xclerc Assigned To => xclerc
2012-11-21 14:11 xclerc Status new => assigned
2013-07-11 20:46 doligez Target Version => 4.01.0+dev
2013-08-19 15:56 doligez Target Version 4.01.0+dev => 4.01.1+dev
2013-08-19 15:58 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser}) => OCaml tools (ocaml{lex,yacc,dep,browser,debug})
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-18 20:36 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-24 19:46 doligez Target Version undecided => 4.02.2+dev
2014-12-05 14:50 gasche Relationship added duplicate of 0006684
2014-12-13 16:35 gasche Note Added: 0012792
2014-12-13 16:35 gasche Status assigned => resolved
2014-12-13 16:35 gasche Fixed in Version => 4.03.0+dev
2014-12-13 16:35 gasche Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker