Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badly chosen temp file (race condition) #2711

Closed
vicuna opened this issue Mar 20, 2001 · 2 comments
Closed

Badly chosen temp file (race condition) #2711

vicuna opened this issue Mar 20, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 20, 2001

Original bug ID: 314
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Judicaël Courant
Version: ocaml 3.01
OS: Linux
Submission from: ext2.lri.fr (129.175.15.5)

A bug of the -pp option : the temp file ocamlopt and ocamlc choose for a given
file is the same.

Therefore, you can not do safely in parallel

ocamlopt -pp "my_preprocessor" -c foo.ml
and
ocamlc -pp "my_preprocessor" -c foo.ml

(That happened during the build of Coq when using "make -j")

Suggested fix:

Index: optcompile.ml

RCS file: /caml/ocaml/driver/optcompile.ml,v
retrieving revision 1.35
diff -r1.35 optcompile.ml
127c127
< let inputfile = preprocess sourcefile (prefixname ^ ".ppo") in

let inputfile = preprocess sourcefile (prefixname ^ ".ppopt") in

  • changing the doc accordingly

(another way to fix this would be to use Filename.tempfile)

@vicuna
Copy link
Author

vicuna commented Mar 29, 2001

Comment author: administrator

A bug of the -pp option : the temp file ocamlopt and ocamlc choose
for a given file is the same.

Granted. We'll fix that.

(another way to fix this would be to use Filename.tempfile)

I believe we need to have the temp file in the same directory as the
source file, so a variant of Filename.tempfile that preserves the
directory would be needed.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 2, 2001

Comment author: administrator

Fixed 2001-07-02 by XL.

@vicuna vicuna closed this as completed Jul 2, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant