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
core dump using a hashtable #2442
Comments
Comment author: administrator Thanks for the bug report.
On my machine, it says "stack overflow" just before "segmentation It comes from the fact that the Hashtbl module uses polymorphic There's no easy solution to this problem. Maybe someday we'll enhance In the meantime, we'll add a note to the documentation of Hashtbl. -- Damien |
Comment author: administrator Fixed in OCaml 3.01: the new equality code raises cleanly "Out_of_memory" when |
* Implement local allocation for arm64 This patch implements local allocation by adding code emission for local allocation, regions and assembly routine for calling stack relocation. (cherry picked from commit 0694909d1204cb880451e8acbfa7da2398e39c35) * Minor fixes to backend/arm64/emit.mlp * Copy runtime5 implementation of caml_call_local_realloc to runtime4 * Revert ocaml/asmcomp changes * Code size estimate for local allocs * Line lengths * Tweak boundary condition for allocation to match amd64 emitter * New runtime5 implementation for caml_call_local_realloc --------- Co-authored-by: Anmol Sahoo <anmol.sahoo25@gmail.com>
Original bug ID: 104
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name:
Version: applies to all
OS: solaris, linux
Submission from: reichenau.gmd.de (129.26.12.135)
I attach an OCAML programm causing a core dump at laest in versions 2.01 -
3.00.
The program is non-sense, but the core-dump should not be the answer to that
:-)
(* of course, this program is non-sense. I know, that it's silly to use
structural equality for mutable data structures. It is an extract from
an ill-designed name-space-manager.It should compute non-sense,
BUT IT EFFECTS A CORE-DUMP.
reinhard.budde@gmd.de
Run of this file "hbl.ml":
L/ml/Error 16> ocaml
Objective Caml version 2.01
#use "hbl.ml";;
type htlky = | Leaf of int | Node of htlsky
type htlsky = { mutable k1: htlky; mutable k2: int }
val rm_node : htlky -> htlsky =
val v1 : htlky = Node {k1=Node {k1=Leaf 0; k2=5}; k2=8}
val v2 : htlky =
Node {k1=Node {k1=Node {k1=Node {k1=Leaf 0; k2=5}; k2=8}; k2=5}; k2=9}
type htblt = (htlky, int) Hashtbl.t
val ht : htblt =
val tst : unit -> unit =
tst();;
give 2: 2
give 3: 3
got: Not_found
got: Not_found
Segmentation fault
L/ml/Error 17>
*)
type htlky =
| Leaf of int
| Node of htlsky
and htlsky =
{ mutable k1 : htlky;
mutable k2 : int
}
let rm_node = function
| Node n -> n
| _ -> raise (Failure "Leaf instead of Node!")
let v1 = Node { k1=Node {k1=Leaf 0;k2=5};k2=8 }
let v2 = Node { k1=Node {k1=v1;k2=5};k2=9 }
type htblt = (htlky, int) Hashtbl.t
let ht = ( Hashtbl.create 47 : htblt )
let tst () =
Hashtbl.add ht v1 2;
print_string "give 2: "; print_int (Hashtbl.find ht v1); print_newline ();
Hashtbl.add ht v2 3;
print_string "give 3: "; print_int (Hashtbl.find ht v2); print_newline ();
The text was updated successfully, but these errors were encountered: