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: 1495 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Martin Jambon
Version: 3.06 (and 3.04)
OS: i386-Linux (kernel 2.2.20 and 2.4.9)
Submission from: pc-bioinfo1.ibcp.fr (193.51.160.63)
The following program ends with Segmentation fault, with ocaml, ocamlc
and ocamlopt on i386/Linux:
(***************** START ***********************)
type t = { id : int;
mutable next : t list }
let create_chain number_of_cells =
let rec loop cell i =
let new_cell = { id = i;
next = [cell] } in
if i = 0 then new_cell
else loop new_cell (pred i) in
let rec first = { id = 0;
next = [] } in
let last = loop first number_of_cells in
last
let test_data () =
let data = create_data () in
let s = Marshal.to_string data [] in
ignore (Marshal.from_string s 0)
let _ =
Gc.set { (Gc.get ()) with Gc.verbose = 0x010 };
test_data ();
Gc.compact ()
(************************** END OF PROGRAM *******************************)
This problem occurs when large data are loaded using input_value or
Marshal.from_* functions.
The parameter size of the array (60000) may be changed to some other
close value with different results. Here, "+" indicates successful exit
(0) and "-" indicates segmentation fault:
The problem doesn't seem to appear with values below 59900.
output_value followed input_value regenerates an identical file.
The data produced by input_value seems correct but causes malfunctions
during heap compactions. Whether the compactions are automatically
triggered (in OCaml 3.06) or not does not change the result. The
following code will crash during an automatic heap compaction (when i = 2):
let _ =
Gc.set { (Gc.get ()) with Gc.verbose = 0x010 };
for i = 1 to 10; do
print_int i; print_newline ();
test_data ()
done
In practice, I have files containing large and complex marshaled data,
and the crash occurs when the size of the marshaled result (file)
exceeds 10MB (5 out of 2000 tested cases).
The text was updated successfully, but these errors were encountered:
Full_Name: Martin Jambon
In practice, I have files containing large and complex marshaled data,
and the crash occurs when the size of the marshaled result (file)
exceeds 10MB (5 out of 2000 tested cases).
There are some inconsistent assumptions between the code for "intern"
and the compactor. I have fixed them in the current working version
(3.06+20).
You can work around this bug by disabling compaction in your program,
or I can provide a patch.
Original bug ID: 1495
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Martin Jambon
Version: 3.06 (and 3.04)
OS: i386-Linux (kernel 2.2.20 and 2.4.9)
Submission from: pc-bioinfo1.ibcp.fr (193.51.160.63)
The following program ends with Segmentation fault, with ocaml, ocamlc
and ocamlopt on i386/Linux:
(***************** START ***********************)
type t = { id : int;
mutable next : t list }
let create_chain number_of_cells =
let rec loop cell i =
let new_cell = { id = i;
next = [cell] } in
if i = 0 then new_cell
else loop new_cell (pred i) in
let rec first = { id = 0;
next = [] } in
let last = loop first number_of_cells in
last
let create_data () =
Array.init
60000
(fun _ -> create_chain 10)
let test_data () =
let data = create_data () in
let s = Marshal.to_string data [] in
ignore (Marshal.from_string s 0)
let _ =
Gc.set { (Gc.get ()) with Gc.verbose = 0x010 };
test_data ();
Gc.compact ()
(************************** END OF PROGRAM *******************************)
This problem occurs when large data are loaded using input_value or
Marshal.from_* functions.
The parameter size of the array (60000) may be changed to some other
close value with different results. Here, "+" indicates successful exit
(0) and "-" indicates segmentation fault:
59990 +
59991 -
59992 -
59993 +
59994 -
59995 -
59996 +
59997 -
59998 -
59999 +
60000 -
The problem doesn't seem to appear with values below 59900.
output_value followed input_value regenerates an identical file.
The data produced by input_value seems correct but causes malfunctions
during heap compactions. Whether the compactions are automatically
triggered (in OCaml 3.06) or not does not change the result. The
following code will crash during an automatic heap compaction (when i = 2):
let _ =
Gc.set { (Gc.get ()) with Gc.verbose = 0x010 };
for i = 1 to 10; do
print_int i; print_newline ();
test_data ()
done
In practice, I have files containing large and complex marshaled data,
and the crash occurs when the size of the marshaled result (file)
exceeds 10MB (5 out of 2000 tested cases).
The text was updated successfully, but these errors were encountered: