From c44a12ab9136b8d13cec0d9c1f3837b6f92eb283 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 6 Jan 2014 15:13:32 +0100 Subject: STM: fix worker crash when doing vm_compute Kudos to Maximes for finding the culprit in no time! Values of type 'Pre_env.key' store in the OCaml state the 'address' of an already evaluated constant in the VM's C state. Such values are not sent to work processes. The worker is going to re-evaluate the constant, but just once, since the cache is cleared only when the env is marshalled (via ephemerons). --- kernel/csymtable.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kernel/csymtable.ml') diff --git a/kernel/csymtable.ml b/kernel/csymtable.ml index 0111cf74d..b606384ad 100644 --- a/kernel/csymtable.ml +++ b/kernel/csymtable.ml @@ -68,8 +68,10 @@ exception NotEvaluated let key rk = match !rk with - | Some k -> (*Pp.msgnl (str"found at: "++int k);*) k - | _ -> raise NotEvaluated + | None -> raise NotEvaluated + | Some k -> (*Pp.msgnl (str"found at: "++int k);*) + try Ephemeron.get k + with Ephemeron.InvalidKey -> raise NotEvaluated (************************) (* traduction des patch *) @@ -104,7 +106,7 @@ let rec slot_for_getglobal env kn = | BCallias kn' -> slot_for_getglobal env kn' | BCconstant -> set_global (val_of_constant kn) in (*Pp.msgnl(str"value stored at: "++int pos);*) - rk := Some pos; + rk := Some (Ephemeron.create pos); pos and slot_for_fv env fv = -- cgit v1.2.3