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

flambda fails with internal error when objects have mutable fields of type float #7474

Closed
vicuna opened this issue Feb 1, 2017 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Feb 1, 2017

Original bug ID: 7474
Reporter: gerd
Assigned to: @mshinwell
Status: resolved (set by @xavierleroy on 2017-02-16T10:07:00Z)
Resolution: fixed
Priority: high
Severity: crash
Version: 4.04.0
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: back end (clambda to assembly)
Duplicate of: #7426

Bug description

Currently, ocamlnet cannot be built with 4.04+flambda:

ocamlfind ocamlopt -g -safe-string -I ../../src/equeue -I ../../src/netsys -I ../../src/netstring -I ../../src/netgssapi -package "bytes unix" -pp "../../tools/cppo-0.9.4/cppo -include ../../config.cppo -D HAVE_BYTES " -w -25 -c rpc_transport.ml

Fatal error: Assignment of a float to a specialised non-float array: (array.unsafe_set[addr]<>
self/5708
timeout/5703
Parraysetu_arg/5735)

Steps to reproduce

opam install ocamlnet

Additional information

Apparently, this has to do with the mutable field "timeout" in Rpc_transport.internal_rpc_multiplex_controller, which is a float. The build continues when I change the type of the field into something that is not directly a float (e.g. into a float ref). (However, the build fails then with the same error in a different file - could it be that flambda was never really tested with objects?)

The code looks like:

let internal_rpc_multiplex_controller
?(dbg_name = ref "")
?(close_inactive_descr=false)
?(preclose=fun() -> ())
rd_pipe wr_pipe esys
: rpc_multiplex_controller =
let sockaddr = `Implied in
object(self)
val mutable alive = true
val mutable rd_engine = None
val mutable rd_eof = false

val mutable wr_engine = None

val mutable timeout = (-1.0) (* THIS FIELD CAUSES THE ERROR *)
val mutable tmo_notify = (fun () -> ())

...
end

@vicuna
Copy link
Author

vicuna commented Feb 1, 2017

Comment author: @alainfrisch

Duplicate of #7426, a fix is pending review on #965

@vicuna
Copy link
Author

vicuna commented Feb 16, 2017

Comment author: @xavierleroy

#965 was merged in time for release 4.05.

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