After a disconnect, reconnect long running worker threads that were spawn for instance by C-x C-e in a lisp buffer send their output to the void.
Detailed process to reproduce: 1. start an sbcl 2. (require 'asdf) (asdf:oos 'asdf:load-op 'swank) (setq swank:*globally-redirect-io* t) (setq swank:*global-debugger* t) (setf swank:*use-dedicated-output-stream* nil) (swank:create-server :dont-close t :port 4007) 3. connect from slime 4. from a buffer eval (loop (sleep 5) (print 'hello *trace-output*) (force-output *trace-output*)) 5. disconnect [At this point output should be going to the terminal where sbcl was started which is the case when the above snippet is wrapped in (sb-thread:make-thread (lambda () ...))). Instead it goes to nowhere.] 6. slime-connect again 7. observe that nobody says hello anymore
The attached patch aims to fix this by: * swank.lisp (maybe-call-with-io-redirection): don't CALL-WITH-REDIRECTED-IO if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
Cheers, Gábor Melis
Gábor Melis mega@retes.hu writes:
The attached patch aims to fix this by:
- swank.lisp (maybe-call-with-io-redirection): don't
CALL-WITH-REDIRECTED-IO if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
The "problem" with this is that you'll then be able to globally set *STANDARD-OUTPUT* &c to other values in case of *GLOBALLY-REDIRECT-IO* from the REPL. You won't be able to do so when *GLOBALLY-REDIRECT-IO* is NIL, though.
Thus for consistency, I'd suggest to modify CALL-WITH-REDIRECTED-IO to bind *STANDARD-OUTPUT* &c in any case (if *GLOBALLY-REDIRECT-IO* is T, they're just bound to themselves.)
-T.
On Jueves 03 Abril 2008, Tobias C. Rittweiler wrote:
Gábor Melis mega@retes.hu writes:
The attached patch aims to fix this by:
- swank.lisp (maybe-call-with-io-redirection): don't
CALL-WITH-REDIRECTED-IO if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
The "problem" with this is that you'll then be able to globally set *STANDARD-OUTPUT* &c to other values in case of *GLOBALLY-REDIRECT-IO* from the REPL. You won't be able to do so when *GLOBALLY-REDIRECT-IO* is NIL, though.
Thus for consistency, I'd suggest to modify CALL-WITH-REDIRECTED-IO to bind *STANDARD-OUTPUT* &c in any case (if *GLOBALLY-REDIRECT-IO* is T, they're just bound to themselves.)
Updated patch attached.
Tested with sbcl and allegro (with allegro it needs the other *globally-redirect-io* patch sent today).
Cheers, Gabor
Gábor Melis mega@retes.hu writes:
On Jueves 03 Abril 2008, Tobias C. Rittweiler wrote:
Gábor Melis mega@retes.hu writes:
The attached patch aims to fix this by:
- swank.lisp (maybe-call-with-io-redirection): don't
CALL-WITH-REDIRECTED-IO if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
The "problem" with this is that you'll then be able to globally set *STANDARD-OUTPUT* &c to other values in case of *GLOBALLY-REDIRECT-IO* from the REPL. You won't be able to do so when *GLOBALLY-REDIRECT-IO* is NIL, though.
Thus for consistency, I'd suggest to modify CALL-WITH-REDIRECTED-IO to bind *STANDARD-OUTPUT* &c in any case (if *GLOBALLY-REDIRECT-IO* is T, they're just bound to themselves.)
Updated patch attached.
Tested with sbcl and allegro (with allegro it needs the other *globally-redirect-io* patch sent today).
Applied, thanks.
What is the other patch, and has it been applied in the mean time?
-T.
"Tobias C. Rittweiler" tcr@freebits.de writes:
Gábor Melis mega@retes.hu writes:
Updated patch attached.
Tested with sbcl and allegro (with allegro it needs the other *globally-redirect-io* patch sent today).
Applied, thanks.
What is the other patch, and has it been applied in the mean time?
-T.
I reverted the patch again. Global IO redirection seems to be broken currently. It seems to be still broken after reverting the patch, however.
-T.
On Sábado 05 Julio 2008, Tobias C. Rittweiler wrote:
"Tobias C. Rittweiler" tcr@freebits.de writes:
Gábor Melis mega@retes.hu writes:
Updated patch attached.
Tested with sbcl and allegro (with allegro it needs the other *globally-redirect-io* patch sent today).
Applied, thanks.
What is the other patch, and has it been applied in the mean time?
-T.
I reverted the patch again. Global IO redirection seems to be broken currently. It seems to be still broken after reverting the patch, however.
-T.
I've just tested the patch with cvs head and it seems to work for me. I don't know how global io redirection was broken back then. Once thing I had to change in the process to reproduce is to add a (swank::init).
Detailed process to reproduce: 1. start an sbcl 2. (require 'asdf) (asdf:oos 'asdf:load-op 'swank) (setq swank:*globally-redirect-io* t) (setq swank:*global-debugger* t) (setf swank:*use-dedicated-output-stream* nil) (swank:create-server :dont-close t :port 4007) (swank::init) 3. connect from slime 4. from a buffer eval (loop (sleep 5) (print 'hello *trace-output*) (force-output *trace-output*)) 5. disconnect [At this point output should be going to the terminal where sbcl was started which is the case when the above snippet is wrapped in (sb-thread:make-thread (lambda () ...))). Instead it goes to nowhere.] 6. slime-connect again 7. observe that nobody says hello anymore
Gabor