Closed vicuna closed 24 years ago
Comment author: administrator
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.
Comment author: administrator
Fixed on 2000-04-03 by Xavier
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")
%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
%./bugtest jdshlkjshdlkjhsdljaslkjhsk %./bugtestthreads Fatal error: uncaught exception End_of_file