You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5819 Reporter: jm Assigned to:@damiendoligez Status: closed (set by @xavierleroy on 2015-12-11T18:19:41Z) Resolution: fixed Priority: immediate Severity: crash Platform: all OS: all Version: 4.00.1 Target version: 4.01.0+dev Fixed in version: 4.00.2+dev Category: back end (clambda to assembly) Related to:#4141 Monitored by:@hcarty
Bug description
% ocamlopt -version
3.11.2
3.12.1
4.01.0+dev10-2012-10-16
% uname -m
i686
x86_64
% cat t.ml
type t =
{ self : t
; t0 : int
; t1 : int
; t2 : int
; t3 : int
; t4 : int
}
let rec t =
{ self = t
; t0 = 42
; t1 = 42
; t2 = 42
; t3 = 42
; t4 = 42
}
let () =
let rec self = { t with self=self } in
print_int self.self.t0
% ocamlopt t.ml && ./a.out
Segmentation fault
I'm not a back-end specialist, so I cannot really comment on the proposed patch (except that I believe Record_regular should be Types.Record_regular, etc, unless you're already on the record_disambiguation branch!). But while trying to understand the general compilation strategy for recursive bindings, I found the following lines which I don't really understand:
let rec init_blocks = function
...
| (id, exp, RHS_nonrec) :: rem ->
Clet (id, Cconst_int 0, init_blocks rem)
Why do we do that, instead of simply calling "init_block rem" in the RHS_nonrec case? At least, this might allow to catch earlier this kind of bugs. Or are there cases where those dummy bindings are actually needed?
I have uploaded a better patch (provided by XL). I have committed it in the 4.00 branch, but not in trunk because we still need to decide whether/how to refactor this function to make it common to the byte-code and native back-ends.
Fixed in 4.00 (r 13110), but this PR stays open until we rework the code in the trunk.
I don't have an answer to frisch's question for the moment.
Even if we keep this open for further cleanup/sharing, I'd suggest to ensure that the patch will be part of the next release. Unless there is something seriously wrong with it?
Patch #2 was propagated to the trunk by one of Damien's big merges (commit r13699) then cloned in the 4.01 branch. So, all is as it should be. Refactoring can wait. I take the liberty of marking this PR as resolved.
Original bug ID: 5819
Reporter: jm
Assigned to: @damiendoligez
Status: closed (set by @xavierleroy on 2015-12-11T18:19:41Z)
Resolution: fixed
Priority: immediate
Severity: crash
Platform: all
OS: all
Version: 4.00.1
Target version: 4.01.0+dev
Fixed in version: 4.00.2+dev
Category: back end (clambda to assembly)
Related to: #4141
Monitored by: @hcarty
Bug description
% ocamlopt -version
3.11.2
3.12.1
4.01.0+dev10-2012-10-16
% uname -m
i686
x86_64
% cat t.ml
type t =
{ self : t
; t0 : int
; t1 : int
; t2 : int
; t3 : int
; t4 : int
}
let rec t =
{ self = t
; t0 = 42
; t1 = 42
; t2 = 42
; t3 = 42
; t4 = 42
}
let () =
let rec self = { t with self=self } in
print_int self.self.t0
% ocamlopt t.ml && ./a.out
Segmentation fault
File attachments
The text was updated successfully, but these errors were encountered: