Skip to content
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

Crash following pack/unpack/functor application #5364

vicuna opened this issue Sep 29, 2011 · 2 comments


None yet
2 participants
Copy link

commented Sep 29, 2011

Original bug ID: 5364
Reporter: jfc
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-09-25T18:07:21Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.12.1
Fixed in version: 3.12.1+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

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.

File attachments


This comment has been minimized.

Copy link

commented Sep 30, 2011

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


This comment has been minimized.

Copy link

commented Sep 30, 2011

Comment author: @xavierleroy

Fixed in SVN trunk and in 3.12 release branch.

@vicuna vicuna closed this Sep 25, 2012

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.