Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006033OCamlOCaml backend (code generation)public2013-06-05 19:002013-06-10 13:33
Reporterchambart 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version4.01.0+dev 
Summary0006033: [patch] Matching.inline_lazy_force need eta expansion
DescriptionThe function used by inline_lazy_force depend on options in Clflags setted after the evaluation of the Matching module.
TagsNo tags attached.
Attached Filespatch file icon 0001-eta-expand-Matching.inline_lazy_force.patch [^] (1,147 bytes) 2013-06-05 19:00 [Show Content]
? file icon wrong-lazy-force.ml [^] (161 bytes) 2013-06-10 13:33 [Show Content]

- Relationships

-  Notes
(0009413)
frisch (developer)
2013-06-05 19:35

So, one of the branches (presumably the one intended for native code) was never used before?
(0009415)
chambart (developer)
2013-06-05 20:01

Yes, unless the linking order between matching.cmo and optmain.cmo changed in the last 5 years.
It generates awfully slow code for lazy forcing (calling caml_obj_tag)
(0009440)
xleroy (administrator)
2013-06-07 19:16

Well spotted, thanks. Patch applied in trunk (r13758). Will be in 4.01.
(0009447)
gasche (developer)
2013-06-09 16:47

I just bisected a problem with menhir compilation ("make all" segfaults), and this commit seems guilty. I guess that this unused code path was also untested and therefore faulty.

If you want to reproduce the fault:

  wget http://gallium.inria.fr/~fpottier/menhir/menhir-20130116.tar.gz [^]
  tar -xzvf menhir-20130116.tar.gz
  cd menhir-20130116
  make PREFIX=/tmp/
(0009448)
gasche (developer)
2013-06-09 16:59

After some inspection of the menhir compilation process, after this first make the segfault can be reproduced with the minimal command:

  cd src/

  ./menhir.opt --dump --stdlib . fancy-parser.mly

(parser.mly works as well, but an empty grammar doesn't.)
(0009450)
xleroy (administrator)
2013-06-10 13:33

Indeed, the previously-not-exercised code path "inline_lazy_force_switch" was buggy. Minimal repro case appended to this PR. Quick fix by Luc Maranget and I in commit r13761.

- Issue History
Date Modified Username Field Change
2013-06-05 19:00 chambart New Issue
2013-06-05 19:00 chambart File Added: 0001-eta-expand-Matching.inline_lazy_force.patch
2013-06-05 19:35 frisch Note Added: 0009413
2013-06-05 20:01 chambart Note Added: 0009415
2013-06-07 19:16 xleroy Note Added: 0009440
2013-06-07 19:16 xleroy Status new => resolved
2013-06-07 19:16 xleroy Resolution open => fixed
2013-06-07 19:16 xleroy Fixed in Version => 4.01.0+dev
2013-06-09 16:47 gasche Note Added: 0009447
2013-06-09 16:47 gasche Status resolved => feedback
2013-06-09 16:47 gasche Resolution fixed => reopened
2013-06-09 16:59 gasche Note Added: 0009448
2013-06-09 17:01 gasche Severity minor => major
2013-06-10 13:33 xleroy Note Added: 0009450
2013-06-10 13:33 xleroy Status feedback => resolved
2013-06-10 13:33 xleroy Resolution reopened => fixed
2013-06-10 13:33 xleroy File Added: wrong-lazy-force.ml


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker