Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000073OCamlOCaml generalpublic2000-03-30 20:512000-04-03 14:11
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000073: Thread version of input_line
DescriptionFull_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:

1. 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!
==============================================================

2. Create an ml file called bugtest.ml:

====================================================
let file = open_in ("testfile") in
let str = input_line file in
print_string (str ^ "\n")
====================================================

3. Make 2 executables, one linked with the normal pervasives called "bugtest",
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

4. Run the two executables. They should give the same output but the
thread-safe
version doesn't read the file.

%./bugtest
jdshlkjshdlkjhsdljaslkjhsk
%./bugtestthreads
Fatal error: uncaught exception End_of_file


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000342)
administrator (administrator)
2000-04-03 14:08

> 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.

- Xavier Leroy

(0000343)
administrator (administrator)
2000-04-03 14:11

Fixed on 2000-04-03 by Xavier

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker