Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006218OCamlcompiler driverpublic2013-11-02 11:002017-03-01 16:12
Reportergoswin 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version 
Summary0006218: avoid overwriting files when mistakenly setting -o to a source or intermediate filename
DescriptionWhen using the name of an intermediate file as output name the compiler truncates it own files and fails:

% ocamlopt -output-obj -o foo.o foo.ml
foo.o: file not recognized: File truncated
File "caml_startup", line 1:
Error: Error during linking

It would be easier to understand the problem if ocamlopt would catch the name collision.
Steps To Reproduceecho "let () = ()" >foo.ml
ocamlopt -output-obj -o foo.o foo.ml
Tagsjunior_job
Attached Files

- Relationships
related to 0006475resolvedwhitequark -o is ignored for C files 

-  Notes
(0017513)
doligez (administrator)
2017-03-01 15:55

See also:
0006475
GPR#464 ( https://github.com/ocaml/ocaml/pull/464 [^] )
GPR#758 ( https://github.com/ocaml/ocaml/pull/758 [^] )
(0017515)
doligez (administrator)
2017-03-01 16:12

Not sure if this is fixed. I tried the command on MacOSX and it didn't raise any error but the `ld` invocation looks suspect.

- Issue History
Date Modified Username Field Change
2013-11-02 11:00 goswin New Issue
2013-11-02 14:20 gasche Tag Attached: junior_job
2014-05-30 15:19 shinwell Status new => confirmed
2014-06-19 17:21 gasche Summary Doesn't fail with name conflicts => avoid overwriting files when mistakenly setting -o to a source or intermediate filename
2014-07-16 17:21 doligez Severity minor => feature
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-01 15:55 doligez Note Added: 0017513
2017-03-01 15:55 doligez Relationship added related to 0006475
2017-03-01 15:55 doligez Severity feature => tweak
2017-03-01 15:55 doligez Category -OCaml general => compiler driver
2017-03-01 16:12 doligez Note Added: 0017515


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker