| Anonymous | Login | Signup for a new account | 2013-05-25 13:07 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005473 | OCaml | OCaml general | public | 2012-01-12 10:32 | 2012-09-20 18:14 | ||||||
| Reporter | frisch | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||
| Status | confirmed | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | 4.01.0+dev | Fixed in Version | |||||||||
| Summary | 0005473: Double linking of native modules (with -pack) | ||||||||||
| Description | The code below allows us to link several modules with the same name and thus break the type system (-> segfault). Proposal: -pack should fail if one the packed modules depends on the .cmi of a module which is itself not part of the package to be created, and whose signature refers to one the packed modules. In the example: the packed x.cmo depends on the non-packed api.cmi, whose signature mentions Abstract, which itself is part of the package. This creates an opportunity for shadowing Abstract with a different module outside the package. | ||||||||||
| Steps To Reproduce | abstract.mli = sub/abstract.mli: type t val x: t val f: t -> unit abstract.ml: type t = int let x = 10 let f x = Printf.printf "Abstract 1 : %i\n" x sub/abstract.ml: type t = string let x = "foo" let f x = Printf.printf "Abstract 2 : %s\n" x api.ml: let r : Abstract.t list ref = ref [] x.ml = sub/x.ml: let () = Api.r := Abstract.x :: !Api.r; List.iter Abstract.f !Api.r compilation: $ ocamlopt -c abstract.mli abstract.ml api.ml x.ml $ cd sub $ ocamlopt -c -for-pack P -I .. x.ml $ ocamlopt -c -for-pack P -I .. abstract.mli $ ocamlopt -c -for-pack P -I .. abstract.ml $ ocamlopt -pack -o p.cmx abstract.cmx x.cmx $ cd .. $ ocamlopt -o main api.cmx abstract.cmx x.cmx sub/p.cmx $ ./main zsh: segmentation fault ./main | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-01-12 10:32 | frisch | New Issue | |
| 2012-01-12 10:33 | frisch | Relationship added | related to 0004231 |
| 2012-01-17 15:52 | xleroy | Status | new => confirmed |
| 2012-07-10 11:43 | doligez | Target Version | => 4.01.0+dev |
| 2012-07-31 13:36 | doligez | Target Version | 4.01.0+dev => 4.00.1+dev |
| 2012-09-20 18:14 | doligez | Target Version | 4.00.1+dev => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |