| Anonymous | Login | Signup for a new account | 2013-05-23 08:05 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005819 | OCaml | OCaml backend (code generation) | public | 2012-11-10 16:26 | 2012-12-04 16:50 | ||||||
| Reporter | jm | ||||||||||
| Assigned To | doligez | ||||||||||
| Priority | immediate | Severity | crash | Reproducibility | always | ||||||
| Status | confirmed | Resolution | open | ||||||||
| Platform | all | OS | all | OS Version | |||||||
| Product Version | 4.00.1 | ||||||||||
| Target Version | 4.01.0+dev | Fixed in Version | 4.00.2+dev | ||||||||
| Summary | 0005819: ocamlopt generates segfaulting code when using [with] on recursive record with 6+ fields. | ||||||||||
| 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 | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Relationships |
||||||
|
||||||
Notes |
|
|
(0008509) doligez (manager) 2012-11-13 16:36 |
Reproduced with 4.00.2+dev1 on Mac OS X. |
|
(0008510) doligez (manager) 2012-11-14 16:37 |
Here is a patch. I'll get it reviewed by some back-end specialist and then I'll apply it. |
|
(0008517) frisch (developer) 2012-11-16 16:10 edited on: 2012-11-16 16:10 |
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? |
|
(0008560) doligez (manager) 2012-12-04 16:49 |
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. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-11-10 16:26 | jm | New Issue | |
| 2012-11-13 16:36 | doligez | Note Added: 0008509 | |
| 2012-11-13 16:36 | doligez | Status | new => confirmed |
| 2012-11-14 16:32 | doligez | Assigned To | => doligez |
| 2012-11-14 16:32 | doligez | OS | Debian GNU/Linux => all |
| 2012-11-14 16:32 | doligez | OS Version | wheezy => |
| 2012-11-14 16:32 | doligez | Target Version | => 4.00.2+dev |
| 2012-11-14 16:37 | doligez | Note Added: 0008510 | |
| 2012-11-14 19:46 | doligez | File Added: 5819-rec-record-with.patch | |
| 2012-11-16 16:10 | frisch | Note Added: 0008517 | |
| 2012-11-16 16:10 | frisch | Note Edited: 0008517 | View Revisions |
| 2012-11-20 11:09 | doligez | Relationship added | related to 0004141 |
| 2012-12-04 16:26 | doligez | File Added: 5819-rec-record-with-2.patch | |
| 2012-12-04 16:49 | doligez | Note Added: 0008560 | |
| 2012-12-04 16:50 | doligez | Platform | amd64 => all |
| 2012-12-04 16:50 | doligez | Fixed in Version | => 4.00.2+dev |
| 2012-12-04 16:50 | doligez | Target Version | 4.00.2+dev => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |