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

Compilation hangs on unknown module Con #7951

Closed
vicuna opened this issue Nov 15, 2002 · 3 comments
Closed

Compilation hangs on unknown module Con #7951

vicuna opened this issue Nov 15, 2002 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 15, 2002

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

Bug description

Full_Name: Stephanie Weirich
Version: 3.06
OS: Cygwin/Windows XP
Submission from: m561bpc1.cis.upenn.edu (158.130.12.198)

Ok, here's a weird bug. If I reference an unknown module "Con", compilation
(with either ocaml,ocamlc, or ocamlopt) hangs. When I ^C ocaml I get an error
mesage saying that the compiled interface to this unknown module is corrupted.
(See below.)

I'm using Ocaml 3.06 that I compiled myself with Cygwin, following the
installation instructions.

module Foo =
struct
let x = "3"
end
let _ = print_string Con.x

$ ocaml example.ml
(Now I hit ^C)
Corrupted compiled interface con.cmi


The thing is, it only does it for modules named "Con".

module Foo =
struct
let x = "3"
end
let _ = print_string Bar.x

$ ocaml example.ml
File "example.ml", line 6, characters 21-26:
Unbound value Bar.x


Also, creating a module named Con works.

module Con =
struct
let x = "3"
end
let _ = print_string Con.x

$ ocaml example.ml
3

@vicuna
Copy link
Author

vicuna commented Nov 16, 2002

Comment author: administrator

Full_Name: Stephanie Weirich
Version: 3.06
OS: Cygwin/Windows XP

Ok, here's a weird bug. If I reference an unknown module "Con", compilation
(with either ocaml,ocamlc, or ocamlopt) hangs. When I ^C ocaml I get an error
mesage saying that the compiled interface to this unknown module is
corrupted.

You've just bumped into a well-known windows trap: filenames with base
con or prn are reserved. This strange feature dates back to DOS, but
seems to be still there in XP (or is it a cygwin archaism?).
Those two file names represent devices (console and printer IIRC), and
will be selected independently of the extension.
Maybe caml could check for those names on windows?

Just avoid those names.

Jacques Garrigue

@vicuna
Copy link
Author

vicuna commented Nov 16, 2002

Comment author: administrator

Ok, here's a weird bug. If I reference an unknown module "Con",
compilation (with either ocaml,ocamlc, or ocamlopt) hangs.

You've just bumped into a well-known windows trap: filenames with base
con or prn are reserved.

Correct. And also LPT, COM1, COM2, NUL and AUX. And perhaps others --
this list is from memory.

This strange feature dates back to DOS, but
seems to be still there in XP (or is it a cygwin archaism?).

It's a Win32 archaism. I'd guess that Cygwin would work around this
if it were possible...

Maybe caml could check for those names on windows?

I'm less than enthusiastic about reflecting MSDOS cruft in the OCaml
sources... To me, that's just one of the miseries Windows users have
to put up with.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 19, 2002

Comment author: administrator

Windows's MS-DOS heritage shows through :-)

@vicuna vicuna closed this as completed Nov 19, 2002
@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