Menu

#517 Two way stream hangs... in 2.44.1 not 2.41.

lisp error
closed-invalid
clisp (524)
5
2009-07-01
2009-04-22
Big Mike
No

The following code hangs on first read-line in 2.44.1, but worked in 2.41 and earlier.

(ext:letf
(((values stream in out)
(EXT:RUN-PROGRAM (format nil "~a/bin/SPASS" user::*root*)
:arguments (list "-Stdin")
:input :stream
:output :stream
))
(rv nil))

(format stream (spass-encoding query))

(ignore-errors
(read-line stream)
(read-line stream)
(setf spass-result (read-line stream))
(setf rv (not (search "Proof" spass-result))))

(close in)
(close out)
(close stream)
rv))

Discussion

  • Sam Steingold

    Sam Steingold - 2009-04-22

    I cannot reproduce this with either the current cvs head or with clisp 2.47:
    (ext:letf (((values stream in out) (EXT:RUN-PROGRAM "ls" :input :stream :output :stream))) (print (read-line stream)) (close in) (close out) (close stream))
    "ANNOUNCE"
    ==> T
    or simply
    (with-open-stream (i (make-pipe-input-stream "ls")) (read-line i))
    ==> "ANNOUNCE" ; NIL

    note that I do not have the SPASS executable,
    I do not know what user::*root* should be ("/usr"?)
    and I do not have (spass-encoding query).
    could you please try to produce a stand-alone test case?
    couls you please try a newer clisp?
    thanks!

     
  • Big Mike

    Big Mike - 2009-04-22

    Shalom Sam,

    does the following hang the current version? It hangs my 2.44.1 but not 2.41.

    (ext:letf
    (((values stream in out)
    (EXT:RUN-PROGRAM "dc" :input :stream
    :output :stream)))
    (format stream "3~%5~%p~%")
    (format t "~a" (read-line stream))
    (close in)
    (close out)
    (close stream))

    I will get after support to update clisp tomorrow.

    Regards.

     
  • Sam Steingold

    Sam Steingold - 2009-06-16
    • milestone: --> lisp error
    • assigned_to: haible --> sds
    • status: open --> pending-invalid
     
  • Sam Steingold

    Sam Steingold - 2009-06-16

    This bug report is now marked as "pending"/"invalid".
    This means that we think that the problem you report
    is not a problem with CLISP.
    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 agree that this is not a bug in CLISP.

     
  • Sam Steingold

    Sam Steingold - 2009-06-16

    you need to (finish-output stream) or (force-output stream) before (read-line).
    alternatively, use :buffered nil argument when creating streams.
    see http://clisp.cons.org/impnotes/open.html#buffered
    the latter is NOT recommended because buffering is good for performance.

     
  • Big Mike

    Big Mike - 2009-06-16

    Thanks Sam,

    works like a charm now!

    MM

     
  • SourceForge Robot

    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-invalid --> closed-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB