Skip to content

Soundness issue with private rows and module inclusion #7704

Closed

Description

@vicuna

Original bug ID: 7704
Reporter: @yallop
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2018-01-09T07:50:05Z)
Resolution: fixed
Priority: normal
Severity: crash
Fixed in version: 4.06.1+dev/rc1/rc2
Category: typing
Monitored by: igarnier @nojb @gasche

Bug description

With OCaml 4.06.0:

$ cat pr.ml
module M : sig
type t = private [> A of string ] val x : t end = struct type t = private [> A of string | B ] let x = B
end

let _ = match M.x with `A s -> s

$ ocaml pr.ml
Segmentation fault

Additional information

Inspired by PR7703

Activity

  1. vicuna commented on Jan 4, 2018

    @vicuna
    Author

    Comment author: @lpw25

    This seems to have appeared between 4.02.3 and 4.03.0.

  2. vicuna commented on Jan 5, 2018

    @vicuna
    Author

    Comment author: @garrigue

    Well, to be more precise, matching on an open polymorphic variant type without a default case should raise a warning, so this is not directly related to modules.

    Here is a smaller example.

    type t = private [> A of string ];; function (A x : t) -> x;;

    This might be related to the refinement of Parmatch for GADTs, but it's not immediate why, I will look into it.

  3. vicuna commented on Jan 5, 2018

    @vicuna
    Author

    Comment author: @garrigue

    Fix in #1559: #1559

    Someone review please...

  4. vicuna commented on Jan 5, 2018

    @vicuna
    Author

    Comment author: @yallop

    this is not directly related to modules

    Oops -- indeed. Thanks for the diagnosis & fix.

  5. vicuna commented on Jan 9, 2018

    @vicuna
    Author

    Comment author: @garrigue

    Fixed in trunk and 4.06 branch by commits bd1b5a0 and 9d52b4c.

  6. vicuna commented on Jan 10, 2018

    @vicuna
    Author

    Comment author: @garrigue

    Open a new PR (#1564) to provide better naming for the tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions