Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006376OCamltypingpublic2014-04-20 13:312015-12-11 19:26
Assigned Togarrigue 
PlatformOSOS Version
Product Version4.02.0+dev 
Target VersionFixed in Version4.02.0+dev 
Summary0006376: Destructive module substitution allows module aliases to extended paths
DescriptionDestructive module substitution does not check whether the module being replaced is used in an alias, which means you can create aliases to extended paths. Using the usual trick to convert module types into modules, we obtain a segmentation fault:

            OCaml version 4.02.0+dev4-2014-04-03

    # module type Alias = sig module N : sig end module M = N end;;
    module type Alias = sig module N : sig end module M = N end
    # module F (X : sig end) = struct type t end;;
    module F : functor (X : sig end) -> sig type t end
    # module type A = Alias with module N := F(List);;
    module type A = sig module M = F(List) end
    # module rec Bad : A = Bad;;
    Segmentation fault
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
garrigue (manager)
2014-04-21 12:42

Well spotted!
I completely overlooked the fact one could corrupt a module alias this way.

Fixed in trunk, revision 14650, in Includemod.try_modtypes.
Just cause an error in that case (a specialized signature should refine
the original one, and this is impossible here).

- Issue History
Date Modified Username Field Change
2014-04-20 13:31 lpw25 New Issue
2014-04-21 12:42 garrigue Note Added: 0011309
2014-04-21 12:42 garrigue Status new => resolved
2014-04-21 12:42 garrigue Fixed in Version => 4.02.0+dev
2014-04-21 12:42 garrigue Resolution open => fixed
2014-04-21 12:42 garrigue Assigned To => garrigue
2015-12-11 19:26 xleroy Status resolved => closed
2017-02-23 16:45 doligez Category OCaml typing => typing

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker