s-clerc / slyblime

Interactive Lisp IDE with REPL, Inspector, Debugger and more for Sublime Text 4.
Other
44 stars 4 forks source link

Race condition with `:read-mode` #1

Open s-clerc opened 4 years ago

s-clerc commented 4 years ago

It seems like for some reason, there is a desynchronisation between setting the read-mode and receiving input, and eventually Slynk decides it just wants to show a prompt and then we have a problem but I'm not exactly clear why.

How to reproduce:

  1. Start any function which continually demands (read-line) and keeps demanding it on no-input
  2. Press and hold enter until the error appears.

Log files:

Earlier up

b'(:channel-send 1 (:set-read-mode :read))'

b'000026(:EMACS-CHANNEL-SEND 1 (:PROCESS "\n"))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'

Just before the error:

b'000026(:EMACS-CHANNEL-SEND 1 (:PROCESS "\n"))'
b'(:channel-send 1 (:set-read-mode :read))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'

b'000025(:EMACS-CHANNEL-SEND 1 (:PROCESS ""))'
write: [...]
b'(:channel-send 1 (:set-read-mode :read))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'
b'(:channel-send 1 (:prompt "COMMON-LISP-USER" "CL-USER" 1 "#<END-OF-FILE #x30200190788D>"))'

b'000025(:EMACS-CHANNEL-SEND 1 (:PROCESS ""))'
s-clerc commented 4 years ago

One theory is that after process command is sent, no other things must be sent to be processed until finished-read is sent.