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

[BUG] Assertion failure in separate compilation #1027

Closed
dbuenzli opened this issue Jun 21, 2020 · 1 comment
Closed

[BUG] Assertion failure in separate compilation #1027

dbuenzli opened this issue Jun 21, 2020 · 1 comment

Comments

@dbuenzli
Copy link
Contributor

dbuenzli commented Jun 21, 2020

Describe the bug
The following (wrong) simple source file triggers an assertion failure.

> mkdir /tmp/bug
> cd /tmp/bug
> cat - > prop.ml
type t
type prop
external set : t -> prop -> t -> unit = "caml_js_get"
let set_if_some o p = function None -> () | Some v -> set o p v
> ocamlc -c prop.ml 
> js_of_ocaml compile prop.cmo 
js_of_ocaml: You found a bug. Please report it at https://github.com/ocsigen/js_of_ocaml/issues :
Error: File "compiler/lib/generate.ml", line 844, characters 13-19: Assertion failed
Raised at file "compiler/lib/generate.ml", line 844, characters 13-25
Called from file "compiler/lib/generate.ml", line 1190, characters 24-41
Called from file "compiler/lib/generate.ml", line 1239, characters 43-82
Called from file "compiler/lib/generate.ml", line 1300, characters 27-67
Called from file "compiler/lib/generate.ml", line 1301, characters 31-70
Called from file "compiler/lib/generate.ml", line 1342, characters 6-74
Called from file "compiler/lib/generate.ml", line 1586, characters 15-70
Called from file "compiler/lib/generate.ml", line 1588, characters 29-42
Called from file "compiler/lib/generate.ml", line 1636, characters 14-29
Called from file "compiler/lib/generate.ml", line 1666, characters 10-226
Called from file "compiler/lib/generate.ml", line 1473, characters 12-232
Called from file "compiler/lib/generate.ml", line 1878, characters 4-85
Called from file "compiler/lib/generate.ml", line 1018, characters 16-40
Called from file "compiler/lib/generate.ml", line 1239, characters 43-82
Called from file "compiler/lib/generate.ml", line 1300, characters 27-67
Called from file "compiler/lib/generate.ml", line 1342, characters 6-74
Called from file "compiler/lib/generate.ml", line 1659, characters 21-79
Called from file "compiler/lib/generate.ml", line 1473, characters 12-232
Called from file "compiler/lib/generate.ml", line 1659, characters 21-79
Called from file "compiler/lib/generate.ml", line 1473, characters 12-232
Called from file "compiler/lib/generate.ml", line 1878, characters 4-85
Called from file "compiler/lib/generate.ml", line 1918, characters 12-40
Called from file "compiler/lib/generate.ml", line 1930, characters 10-37
Called from file "compiler/lib/driver.ml" (inlined), line 83, characters 21-26
Called from file "compiler/lib/driver.ml", line 444, characters 2-186
Called from file "compiler/lib/driver.ml" (inlined), line 83, characters 21-26
Called from file "compiler/lib/driver.ml", line 444, characters 2-204
Called from file "compiler/lib/driver.ml" (inlined), line 83, characters 21-26
Called from file "compiler/lib/driver.ml", line 444, characters 2-218
Called from file "compiler/lib/driver.ml" (inlined), line 83, characters 21-26
Called from file "compiler/lib/driver.ml", line 444, characters 2-232
Called from file "compiler/lib/driver.ml" (inlined), line 83, characters 21-26
Called from file "compiler/lib/driver.ml", line 444, characters 2-296
Called from file "compiler/lib/stdlib.ml", line 585, characters 11-15
Re-raised at file "compiler/lib/stdlib.ml", line 588, characters 9-16
Re-raised at file "compiler/lib/stdlib.ml", line 594, characters 6-15
Called from file "compiler/bin-js_of_ocaml/compile.ml", line 172, characters 8-625
Called from file "compiler/bin-js_of_ocaml/compile.ml", line 258, characters 8-49
Called from file "cmdliner_term.ml", line 25, characters 19-24
Called from file "cmdliner.ml", line 117, characters 32-39
Called from file "cmdliner.ml", line 147, characters 18-36
Called from file "cmdliner.ml", line 265, characters 22-48
Called from file "compiler/bin-js_of_ocaml/js_of_ocaml.ml", line 48, characters 4-225

Expected behavior
Maybe something more helpful. In this particular of course the primitive is wrong. It should be caml_js_set

Versions

ocamlc -version
4.09.0
js_of_ocaml --version
3.6.0

@hhugo
Copy link
Member

hhugo commented Sep 30, 2021

Correct me if I'm wrong but this is not specific to separate compilation. Maybe update title.

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

2 participants