Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zmodem transfers/cancellations hang terminal #46

Open
dmartin opened this issue Aug 11, 2022 · 7 comments
Open

Zmodem transfers/cancellations hang terminal #46

dmartin opened this issue Aug 11, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@dmartin
Copy link

dmartin commented Aug 11, 2022

What version of GoTTY are you using (gotty --version)?

1.4.0

What operating system and browser are you using?

Ubuntu 22.04, Chrome

What did you do?

If possible, please provide the command you ran.

./gotty -p 7681 -w bash

What did you expect to see?

Action Expected Behavior
rz, cancel upload (close modal) rz exits and terminal prompt advances
sz <filename>, click Accept File is transferred to browser, terminal prompt advances
sz <filename>, click Decline sz exits and terminal prompt advances
sz <filename>, close modal sz exits and terminal prompt advances

What did you see instead?

If possible, please provide the output of the command and your browser's console output.

Action Observed Behavior
rz, cancel upload (close modal) Prompt is stuck on rz waiting to receive.**B0100000023be50
sz <filename>, click Accept File is transferred to browser, terminal prompt is stuck on **B00000000000000, JavaScript console reports errors: Uncaught PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: ... at zsession.js:563
sz <filename>, click Decline Modal displays "Skipping..." until manually closed, JavaScript console reports errors: Uncaught PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: ..., sz: skipped: <filename> is written to terminal but prompt is stuck
sz <filename>, close modal Prompt is stuck on **B00000000000000 until it eventually times out
@sorenisanerd
Copy link
Owner

Ugh. That does not look great. :( I wonder if all of these are caused by the same core issue. It sounds like I'm not resetting the Zmodem state correctly at the right times.

@sorenisanerd sorenisanerd added the bug Something isn't working label Aug 28, 2022
@sorenisanerd sorenisanerd self-assigned this Sep 1, 2022
sorenisanerd added a commit that referenced this issue Sep 2, 2022
@sorenisanerd
Copy link
Owner

Thank you very much for this bug report. I really appreciate your attention to detail. It was very, very helpful.

Here's a test build:
https://github.com/sorenisanerd/gotty/actions/runs/2976008354

Can you take it for a spin? Thanks!

sorenisanerd added a commit that referenced this issue Sep 2, 2022
@dmartin
Copy link
Author

dmartin commented Sep 8, 2022

Hi @sorenisanerd, it seems like there are some improvements with that build, still seeing some issues with sz handling though.

  • Cancelling rz uploads does work now!
  • Still seeing the same results (JavaScript protocol error and hung prompt) when accepting or declining an sz-initiated download.
  • Closing the sz modal now seems to work the same as choosing "Decline" but encounters the same issues.

@sorenisanerd
Copy link
Owner

sorenisanerd commented Sep 8, 2022

Ugh. It works for me. I guess I'm looking for a race condition. Thanks for checking! I'll get back to you when I've dug deeper :)

@dmartin
Copy link
Author

dmartin commented Sep 8, 2022

Thanks for looking into it, but please don't stress too much on my account! This is not blocking any work for me, just something I ran into while testing out terminal-sharing tools.

@luohailong
Copy link

luohailong commented Sep 22, 2022

Same problem

@sorenisanerd
Copy link
Owner

I've spent a lot of time trying to reliably reproduce this. It happens sometimes, but I've been unable to trigger it while running either gotty, bash, or sz under strace. I've tried many other ways to observe what is happening, but whenever I get close, it stops happening. What I have been able to observe is that occasionally, the terminating OO from sz gets swallowed SOMEWHERE, but it's a bit of a mystery where or why. The gotty process on the server simply does not see it, so it can't pass it along to the frontend.

Are you doing anything interesting with your command prompt? $PS1 trickery? PROMPT_COMMAND doing anything cool? I don't know. I'll keep digging, but even if this turns out to be a bug in lrzsz or something, we have to support existing versions of it, so I'll whip up a patch for zmodemjs to fix it.

Fwiw, we're not alone:
tsl0922/ttyd#239
tsl0922/ttyd#279
Eugeny/tabby#6259
cferdinandi/tabby#132
Eugeny/tabby#5196
trzsz/tabby-trzsz#2
Eugeny/tabby#5132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants