Attempt to unread too many characters ...

My office mate and I both use Slime with Franz Allegro Lisp and we both see this problem. It's been occuring for the past couple of years since we started using slime and I'm finally annoyed enough with it to dig in and try to fix it. If anyone can point me in the right direction it would be appreciated. The problem: In short, any restart which tries to take an argument causes the error
attempt to unread too many characters on #<TWO-WAY-STREAM "" @ #x10000ee1ad2> [Condition of type SIMPLE-ERROR]
For example, in a fresh REPL:
; SLIME 2013-09-29 CL-USER> a
Which results in:
Attempt to take the value of the unbound variable `A'. [Condition of type UNBOUND-VARIABLE]
Restarts: 0: [TRY-AGAIN] Try evaluating A again. 1: [EVALUATE-ALTERNATIVE] Use :A instead. 2: [STORE-VALUE] Set the symbol-value of A and use its value. 3: [USE-VALUE] Use a value without setting A. 4: [RETRY] Retry SLIME REPL evaluation request. 5: [*ABORT] Return to SLIME's top level. --more--
Select restart #2 and enter the value 10
enter an expression which will evaluate to a new value: 10
Results in:
attempt to unread too many characters on #<TWO-WAY-STREAM "" @ #x100010c8c22> [Condition of type SIMPLE-ERROR]
Restarts: 0: [EVALUATE-ALTERNATIVE] Use :A instead. 1: [STORE-VALUE] Set the symbol-value of A and use its value. 2: [USE-VALUE] Use a value without setting A. 3: [RETRY] Retry SLIME REPL evaluation request. 4: [*ABORT] Return to SLIME's top level. 5: [ABORT] Abort entirely from this (lisp) process.
Is this a problem with Franz Lisp? Slime, Swank? I'm not really sure where I should start looking at this point. Any help is appreciated. Thanks, Andrew Myers

Andrew Myers <asm198@gmail.com> writes:
attempt to unread too many characters on #<TWO-WAY-STREAM "" @ #x100010c8c22> [...] Is this a problem with Franz Lisp? Slime, Swank? I'm not really sure where I should start looking at this point. Any help is appreciated.
I believe this is an ACL bug. You can reproduce it independently of slime-repl as follows: (handler-bind ((error (lambda (e) (let ((*query-io* (make-two-way-stream (swank-backend:make-input-stream (lambda () (format nil "10~%"))) *query-io*))) (invoke-restart-interactively 'store-value))))) (eval 'a)) It seems that INVOKE-RESTART-INTERACTIVELY or something else more specific to the STORE-VALUE restart is doing too many UNREAD-CHARs which is not supported by the gray stream that SWANK has setup for *QUERY-IO*. (I don't remember enough details about gray streams to know whether this a general gray stream thing or something else.) Also, this happens in ACL 9.0 but not ACL 8.1. Can you report it to Franz? Cheers, Luís

Thanks for narrowing down the behavior. I've queried Franz about it and will let you know what their response is. Andrew On 10/17/2013 06:25 AM, Luís Oliveira wrote:
Andrew Myers <asm198@gmail.com> writes:
attempt to unread too many characters on #<TWO-WAY-STREAM "" @ #x100010c8c22> [...] Is this a problem with Franz Lisp? Slime, Swank? I'm not really sure where I should start looking at this point. Any help is appreciated. I believe this is an ACL bug. You can reproduce it independently of slime-repl as follows:
(handler-bind ((error (lambda (e) (let ((*query-io* (make-two-way-stream (swank-backend:make-input-stream (lambda () (format nil "10~%"))) *query-io*))) (invoke-restart-interactively 'store-value))))) (eval 'a))
It seems that INVOKE-RESTART-INTERACTIVELY or something else more specific to the STORE-VALUE restart is doing too many UNREAD-CHARs which is not supported by the gray stream that SWANK has setup for *QUERY-IO*. (I don't remember enough details about gray streams to know whether this a general gray stream thing or something else.)
Also, this happens in ACL 9.0 but not ACL 8.1.
Can you report it to Franz?
Cheers, Luís

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've talked to Franz about this and they're working on a patch for 9.0 and later for 8.2. Thanks for the help, Andrew On 10/17/2013 06:25 AM, Luís Oliveira wrote:
Andrew Myers <asm198@gmail.com> writes:
attempt to unread too many characters on #<TWO-WAY-STREAM "" @ #x100010c8c22> [...] Is this a problem with Franz Lisp? Slime, Swank? I'm not really sure where I should start looking at this point. Any help is appreciated.
I believe this is an ACL bug. You can reproduce it independently of slime-repl as follows:
(handler-bind ((error (lambda (e) (let ((*query-io* (make-two-way-stream (swank-backend:make-input-stream (lambda () (format nil "10~%"))) *query-io*))) (invoke-restart-interactively 'store-value))))) (eval 'a))
It seems that INVOKE-RESTART-INTERACTIVELY or something else more specific to the STORE-VALUE restart is doing too many UNREAD-CHARs which is not supported by the gray stream that SWANK has setup for *QUERY-IO*. (I don't remember enough details about gray streams to know whether this a general gray stream thing or something else.)
Also, this happens in ACL 9.0 but not ACL 8.1.
Can you report it to Franz?
Cheers, Luís
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSZSEyAAoJELwmtL8s8iv9w70QAJyDim++L+qZZoph3BhiQ7lV fWu6REYl6aQevd9eMFAuDo8hD4DfD7/rf5Zvfhg9qYKiIIsbpIPs6wMKSTMUFqEi qWTsZZGDWOdx5Q9B+kQbSQloIG+gE2FEWZIm5rxfu9QTlBnGlmu030rJciPJPXDh TQtJlw7hUY6AX2pg0bJ5GOYdP1Nt28sJkc+SYzCC3ZcbmAijuPu6XWmzyHEOyFVT PDgMwpWJSsnfXXd/hnT/UFTR7fqGG4AEMfYKZih/bTq1M82cwAbi584Wr9i2Qzmw JpP96j0vRTRuM+gB2HUNBQXmI5mEQbUYWY6tyT42r7+yKyI6pQ5nuIQngxomRNaj 2nJpQ+uCZsGVtsSlVZ+vUucJrtX9DrpHmSU9NmvIxkLLs7b5KontRZgmoLdreSz2 QwefvIR26qU3eIsSkwCBcI+9ZODup5awy3rxbbuW/ktx7Wzqqbob1XOhwy2z2b8R 840+BXLayG1qr9AeTZb2BThN/+WTH6nI+A4xPAVE5frLCAEav6jvPjNjG+tc1I2t y9IDHhCFHij6ozMm8bcscvAcobPdvUEs4Ax6nEyp/UOtSqKke10y+h4fANSPP72w EMkbDNOrb29af2n8XFwScpd3LiE2P2S2qt1VVoTgfQC0TcYdZdi535/pYiEeEaQJ bBSCwJoVhQLRoaRhcJhR =EG2z -----END PGP SIGNATURE-----
participants (3)
-
Andrew
-
Andrew Myers
-
Luís Oliveira