You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 73 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Michael McDougall
Version: 2.01, 2.02, 2.04
OS: Linux (2.01, 2.04) & Solaris 2.02
Submission from: halifax.cis.upenn.edu (158.130.66.10)
The problem:
The version of input_line which gets linked when you use the threads library
will not return the contents of a 1 line file. It returns an EOF exception.
The non-Threads version works fine.
How to reproduce:
create a file 'testfile' that contains 1 line of text (ie. no '\n'
characters).
Example:
(==== signifies start/end of a file)
==============================================================
A one line file!
==============================================================
Create an ml file called bugtest.ml:
====================================================
let file = open_in ("testfile") in
let str = input_line file in
print_string (str ^ "\n")
Make 2 executables, one linked with the normal pervasives called "bugtest",
the other with the thread-safe pervasives called "bugtestthreads".
The version of input_line which gets linked when you use the threads library
will not return the contents of a 1 line file. It returns an EOF exception.
The non-Threads version works fine.
You're right. I just fixed this. Thanks for the bug report.
Original bug ID: 73
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Michael McDougall
Version: 2.01, 2.02, 2.04
OS: Linux (2.01, 2.04) & Solaris 2.02
Submission from: halifax.cis.upenn.edu (158.130.66.10)
The problem:
The version of input_line which gets linked when you use the threads library
will not return the contents of a 1 line file. It returns an EOF exception.
The non-Threads version works fine.
How to reproduce:
create a file 'testfile' that contains 1 line of text (ie. no '\n'
characters).
Example:
(==== signifies start/end of a file)
==============================================================
A one line file!
==============================================================
Create an ml file called bugtest.ml:
====================================================
let file = open_in ("testfile") in
let str = input_line file in
print_string (str ^ "\n")
the other with the thread-safe pervasives called "bugtestthreads".
%ocamlc -c bugtest.ml
%ocamlc -custom unix.cma -cclib -lunix
-o bugtest bugtest.cmo
%ocamlc -thread -custom unix.cma -cclib -lunix threads.cma -cclib
-lthreads
-o bugtestthreads bugtest.cmo
thread-safe
version doesn't read the file.
%./bugtest
jdshlkjshdlkjhsdljaslkjhsk
%./bugtestthreads
Fatal error: uncaught exception End_of_file
The text was updated successfully, but these errors were encountered: