Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash following pack/unpack/functor application #5364
Original bug ID: 5364
This is a reduced version of a program I sent to the email list. It crashes whether interpreted or compiled with ocamlc or ocamlopt version 3.12.1 or svn latest ("OCaml version 3.13.0+dev7 (2011-09-22)"), all using amd64 architecture.
The problem may be improper permutation of the fields of a module passed to Hashtbl.Make. In this case a value of type out_channel contains an int. In the original program a value of out_channel was a heap block.
Comment author: @xavierleroy
I confirm the lack of a "thinning" operation on structure representations. The smaller example below shows the issue: no thinning takes place at ((val m : T) : S).
module type S = sig val f: int -> int end
module type T = sig val x: int val f: int -> int end
let m = (module struct let x = 1 let f x = x+1 end : T)
module M = ((val m : T) : S)
let crash = M.f 42