#257 read-char-no-hang broken on cygwin

lisp error
closed-works-for-me
clisp (525)
5
2005-09-12
2005-06-06
No

Hi,

I am using clisp 2.33.1 on cygwin. (I realize that the
current version of clisp is 2.33.2, but 2.33.1 is what
is listed as "current" on cygwin.) When I try to
read-char-no-hang from a file, I find that some
characters are missed. I do not see this behavior on
Linux using clisp 2.33.2.

Here is an example demonstrating the bug. The following
code uses read-char to copy the file foon.mac to fhe
file tmp.out, then uses read-char-no-hang to copy the
file foon.mac to the file tmp-no-hang.out.
------------------------------------------------------------------------
(defun readit-no-hang (&optional (stream *standard-input*))
(let ((out-stream (open "tmp-no-hang.out" :direction
:output
:if-exists :overwrite
:if-does-not-exist :create
:external-format :unix)))
(do ((ch (read-char-no-hang stream nil 'eof)
(read-char-no-hang stream nil 'eof)))
((eql ch 'eof) t)
(if ch
(write-char ch out-stream)
(format t "not hanging!~%")))
(close out-stream)))

(defun readit (&optional (stream *standard-input*))
(let ((out-stream (open "tmp.out" :direction :output
:if-exists :overwrite
:if-does-not-exist :create
:external-format :unix)))
(do ((ch (read-char stream nil 'eof)
(read-char stream nil 'eof)))
((eql ch 'eof) t)
(write-char ch out-stream))
(close out-stream)))

(readit (open "foon.mac"))
(readit-no-hang (open "foon.mac"))
------------------------------------------------------------------------

The file foon.mac contains the line
abcdefghijklmnopqrstuvwxyz;
repeated 1642 times. (It's just a random file I created
for testing.)

In all cases (cygwin and Linux) tmp.out and foon.mac
are identical. On cygwin, however, tmp-no-hang.out and
foon.mac differ:

|abacus3>diff tmp-no-hang.out foon.mac
1d0
< bcdefghijklmnopqrstuvwxyz;
147d145
< abcdefghiklmnopqrstuvwxyz;
293d290
< abcdefghijklmnopqrtuvwxyz;
439d435
< abcdefghijklmnopqrstuvwxyz;abcdefghijklmnopqrstuvwxyz;
585d580
< abcdefghjklmnopqrstuvwxyz;
731d725
< abcdefghijklmnopqstuvwxyz;
877d870
< abcdefghijklmnopqrstuvwxyz
1024d1016
< abcdefgijklmnopqrstuvwxyz;
1170d1161
< abcdefghijklmnoprstuvwxyz;
1316d1306
< abcdefghijklmnopqrstuvwxy;
1463d1452
< abcdefhijklmnopqrstuvwxyz;
1609c1598,1610
< abcdefghijklmnoqrstuvwxyz;
---
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
> abcdefghijklmnopqrstuvwxyz;
|abacus3>

Sadly, this bug causes the test suite in the cvs
version of Maxima to fail horribly.

--Jim Amundson

Discussion

  • Sam Steingold

    Sam Steingold - 2005-06-21

    lisp code

     
  • Sam Steingold

    Sam Steingold - 2005-06-21

    Logged In: YES
    user_id=5735

    I cannot reproduce this:
    $ ./clisp ../../bugs/rcnh.lisp
    $ cmp ../../bugs/foon.mac tmp.out
    $ cmp ../../bugs/foon.mac tmp-no-hang.out
    $

     
  • Sam Steingold

    Sam Steingold - 2005-06-21

    Logged In: YES
    user_id=5735

    (I mean, I cannot reproduce this with the current cvs head -
    please try it!)

     
  • Sam Steingold

    Sam Steingold - 2005-06-21

    data

     
  • Sam Steingold

    Sam Steingold - 2005-06-21

    Logged In: YES
    user_id=5735

    "foon.mac" has unix line termination because otherwise the
    copying will not result in an identical file anyway

     
  • Sam Steingold

    Sam Steingold - 2005-08-28

    Logged In: YES
    user_id=5735

    This bug report is now marked as "pending"/"works for me".
    This means that we think that we cannot reproduce the problem
    and cannot do anything about it.
    Unless you - the reporter - act within 2 weeks,
    the bug will be permanently closed.
    Sorry about the inconvenience -
    we hope your silence means that
    you are no longer observing the problem either.

     
  • Sam Steingold

    Sam Steingold - 2005-08-28
    • status: open --> pending
     
  • Sam Steingold

    Sam Steingold - 2005-08-28
    • status: pending --> pending-works-for-me
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks