You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6444 Reporter: Reventlov Assigned to:@gasche Status: closed (set by @xavierleroy on 2015-12-11T18:27:41Z) Resolution: not a bug Priority: normal Severity: crash Platform: Linux OS: Archlinux OS Version: Up to date Version: 4.01.0 Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
Ocaml toplevel segfault when using the code below (the last line is syntactically incorrect but trigger the crash).
Steps to reproduce
let write_sys sys file =
let oc = Pervasives.open_out file in
Pervasives.output_value oc sys;
close_out oc;;
let read_sys file =
let ic = Pervasives.open_in file in
let sys = Pervasives.input_value ic in
close_in ic;
sys;;
input_value has a polymorphic type, and it is the programmer's responsibility to give it the correct type (the type of the value that is being read). In this example you marshall a tuple that you unmarshall as a function, and "of course" this segfaults. It is not a bug. If you want a safe (un)pickling library, you should not use Marshal or {input,output}_value.
Original bug ID: 6444
Reporter: Reventlov
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:27:41Z)
Resolution: not a bug
Priority: normal
Severity: crash
Platform: Linux
OS: Archlinux
OS Version: Up to date
Version: 4.01.0
Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
Ocaml toplevel segfault when using the code below (the last line is syntactically incorrect but trigger the crash).
Steps to reproduce
let write_sys sys file =
let oc = Pervasives.open_out file in
Pervasives.output_value oc sys;
close_out oc;;
let read_sys file =
let ic = Pervasives.open_in file in
let sys = Pervasives.input_value ic in
close_in ic;
sys;;
write_sys (1,2) "/tmp/a";;
(read_sys "/tmp/a") (read_sys "/tmp/a");;
The text was updated successfully, but these errors were encountered: