Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007706OCamltypingpublic2018-01-11 12:002018-04-10 12:35
Reporterlpw25 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.06.0 
Target VersionFixed in Version4.07.0+dev/beta2 
Summary0007706: Recursive value check too relaxed -- produces segfault
DescriptionThe new recursive value check is too relaxed in how it treats [let] when it decides if a recursive definition's size can be calculated in advance:

        OCaml version 4.06.0+beta1

# let rec x =
    let y = if false then (fun z -> 1) else (fun z -> x 4 + 1) in
    y;;
    val x : int -> int = <fun>
# x 42;;

Process ocaml-toplevel segmentation fault
TagsNo tags attached.
Attached Files

- Relationships
related to 0007768assignedlpw25 some accepted recursive values exhibit erroneous behavior with unexpected shallow copies 

-  Notes
(0018825)
gasche (developer)
2018-01-11 12:34

Good catch!

The problem is that identifiers are considered to be static size; in your example, "y" is considered static-sized, so the definition is accepted. This is clearly wrong for local identifiers, but it is not clear to me why it should be correct for non-local identifiers (or for identifiers defined in the same letrec-block).
(0018826)
gasche (developer)
2018-01-11 12:39

Tentative fix: https://github.com/ocaml/ocaml/pull/1565 [^]
(0019003)
gasche (developer)
2018-04-10 12:35

Fixed in 4.07 by the above pull request.

A followup issue was found by Leo and is tracked by MPR#7768.

- Issue History
Date Modified Username Field Change
2018-01-11 12:00 lpw25 New Issue
2018-01-11 12:34 gasche Note Added: 0018825
2018-01-11 12:34 gasche Status new => acknowledged
2018-01-11 12:39 gasche Note Added: 0018826
2018-04-10 12:35 gasche Note Added: 0019003
2018-04-10 12:35 gasche Status acknowledged => resolved
2018-04-10 12:35 gasche Fixed in Version => 4.07.0+dev/beta2
2018-04-10 12:35 gasche Resolution open => fixed
2018-04-10 12:35 gasche Assigned To => gasche
2018-04-10 12:35 gasche Relationship added related to 0007768


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker