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
Cyclic module aliases can crash the compiler #7694
Comments
Comment author: @lpw25 This particular example is due to the "unfold all module aliases" behaviour of [module type of] (a similar thing would happen with [with module M =]). This behaviour causes a lot of other problems as well, and I'm hoping to get rid of it for 4.07. Of course, there might be other parts of the type-checker where this causes problems. |
Cannot reproduce in 4.07, so I'm assuming it has been fixed. @lpw25 ? |
That example was fixed by the change in behaviour of |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Let's close this until someone hits another reproduction case |
Original bug ID: 7694
Reporter: @let-def
Status: new
Resolution: open
Priority: normal
Severity: minor
Version: 4.06.0
Category: typing
Monitored by: @gasche
Bug description
When there is a cycle between module aliases, some function enter infinite loops and crash the compiler.
Steps to reproduce
$ cat > a.ml
module B = B
$ cat > b.ml
module A = A
$ ocamlc -c -no-alias-deps a.ml b.ml
$ cat > test.ml
module T : module type of A = struct end
$ ocamlc -c test.ml
Fatal error: exception Stack overflow
Additional information
This problem was first reported in Merlin, which misbehaved when using the the clarity library (https://github.com/IndiscriminateCoding/clarity) together with short-paths.
Clarity has this cyclic shape where Clarity = Clarity.Clarity
The text was updated successfully, but these errors were encountered: