Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005611OCamlOCaml generalpublic2012-05-10 08:402012-09-21 14:17
Reporterguesdon 
Assigned Tomeyer 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.00.0+dev 
Target Version4.01.0+devFixed in Version4.01.0+dev 
Summary0005611: Fatal error: exception End_of_file when using -o file.cmo
DescriptionGiving a .cmo file to -o option of ocamlc without -c ends with a fatal error.
Steps To Reproduce# ocamlc -v
The OCaml compiler, version 4.00.0+dev17_2012-05-02
Standard library directory: /opt/ocaml-4/lib/ocaml
# cat > t.ml
let x = 1;;
# ocamlc -o t.cmo t.ml
Fatal error: exception End_of_file

But the following works:
# ocamlc -c -o t.cmo t.ml
# ocamlc -o t.x t.ml
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007669)
doligez (administrator)
2012-07-09 15:03

This works too:
# ocamlc -o x.cmo t.ml

My guess: when you say "ocamlc -o t.cmo t.ml", the compiler first compiles t.ml to t.cmo, then tries to link the t.cmo object file to produce an executable named t.cmo. At some point, it opens t.cmo for writing (thus erasing it), then tries to copy data from t.cmo to t.cmo, which fails.

I think we need a better error message. In the meantime, the workaround is obvious: don't do that.

Also, I have no idea how it could work in 3.12.1...
(0007994)
meyer (developer)
2012-09-01 15:11

Improved error message to avoid clashes: r12901
(0008138)
doligez (administrator)
2012-09-21 14:17

r 12901 (in trunk) fixes this.

- Issue History
Date Modified Username Field Change
2012-05-10 08:40 guesdon New Issue
2012-05-10 16:14 meyer Assigned To => meyer
2012-05-10 16:14 meyer Status new => assigned
2012-07-09 15:03 doligez Note Added: 0007669
2012-07-09 15:03 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-01 15:11 meyer Note Added: 0007994
2012-09-21 14:17 doligez Note Added: 0008138
2012-09-21 14:17 doligez Status assigned => resolved
2012-09-21 14:17 doligez Resolution open => fixed
2012-09-21 14:17 doligez Fixed in Version => 4.01.0+dev
2012-09-21 14:17 doligez Target Version 4.00.1+dev => 4.01.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker