Skip to content
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

compiler error with flambda #7645

Closed
vicuna opened this issue Sep 28, 2017 · 11 comments
Closed

compiler error with flambda #7645

vicuna opened this issue Sep 28, 2017 · 11 comments

Comments

@vicuna
Copy link

vicuna commented Sep 28, 2017

Original bug ID: 7645
Reporter: @c-cube
Assigned to: @chambart
Status: confirmed (set by @chambart on 2017-10-02T18:27:44Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.05.0
Category: middle end (typedtree to clambda)
Duplicate of: #3922
Related to: #7349
Monitored by: @gasche @mshinwell @chambart

Bug description

When compiling the (very ugly) ml file in the linked archive, ocaml 4.05.0+flambda gives the following error:

Warning 58: no cmx file was found in path for module CCFun, and its interface was not compiled with -opaque

Fatal error: Map.disjoint_union Logtk.camlLogtk__Util__set_of_closures_anon-fn[/home/simon/.opam/4.05.0+flambda/build/ocaml/stdlib/format.ml:1248,4--46]_10533 => Util._1 <> Logtk._976
Fatal error: exception Misc.Fatal_error

Steps to reproduce

archive: https://cedeela.fr/~simon/files/bugflambda.tar.gz

  • switch to 4.05.0+flambda
  • install containers
  • $ tar xvf bugflambda.tar.gz
  • $ ocamlfind ocamlopt -c -package containers logtk.cmxa -I . parse_dk.ml

should yield the error. Sorry for the size of the archive, it only seems to happen when .cmx files are present (not if there's only a cmxa), so I suspect it's related to inlining.

@vicuna
Copy link
Author

vicuna commented Sep 28, 2017

Comment author: @c-cube

I think the error is caused by the same module (Util) being present both in packed and unpack forms. This is the case because I forgot an open in an oasis project, and the error doesn't happen if Util is only accessed through the pack.

However the error should probably be caught earlier! :)

@vicuna
Copy link
Author

vicuna commented Sep 29, 2017

Comment author: zozozo

The error seems similar to the one I reported in #7349

@vicuna
Copy link
Author

vicuna commented Sep 30, 2017

Comment author: @xavierleroy

Pierre or Mark, could you please have a look at this one?

@vicuna
Copy link
Author

vicuna commented Oct 2, 2017

Comment author: @chambart

Yes this looks likely to be the pack problem. I can't be absolutely certain without the whole build, but this is highly probable given the contents of the cmx files.

I suggest that we simply forbid (or at least quite visibly warn) linking to a module built with -for-pack when not using the same -for-pack.

@vicuna
Copy link
Author

vicuna commented Oct 2, 2017

Comment author: @chambart

The gpr #1391 proposes such a change.

@github-actions
Copy link

github-actions bot commented May 7, 2020

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.

@github-actions github-actions bot added the Stale label May 7, 2020
@lthls
Copy link
Contributor

lthls commented May 7, 2020

There is ongoing work on improving the situation with packs (and a few other related issues). There is an RFC describing the proposal at ocaml/RFCs#13.
Until then the problem remains.

@lpw25 lpw25 removed the Stale label May 7, 2020
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label May 12, 2021
@gasche
Copy link
Member

gasche commented May 12, 2021

This should be solved by #1391, but that PR is in a suspend state with neither @chambart nor @mshinwell available to look at it.

@github-actions github-actions bot removed the Stale label May 14, 2021
@github-actions
Copy link

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.

@lthls
Copy link
Contributor

lthls commented Jul 1, 2022

Note: I've got a rebased version of #1391 here.
I'll try to do a few checks on opam packages, and will work with @chambart next week on getting it merged.

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

No branches or pull requests

6 participants