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

SU timeout results in abort of graphic #3779

Closed
dankamongmen opened this issue Jul 1, 2021 · 6 comments
Closed

SU timeout results in abort of graphic #3779

dankamongmen opened this issue Jul 1, 2021 · 6 comments
Labels

Comments

@dankamongmen
Copy link
Contributor

dankamongmen commented Jul 1, 2021

If kitty is in the middle of a Synchronized Update, and furthermore in the middle of a graphic, and times out (or possibly gets en empty read), the graphic is aborted, resulting in:

  • much graphic data (base64-encoded) being dumped to output
  • various errors on the console, depending on where exactly the graphic was interrupted

examples:

[182 03:53:43.767361] [PARSE ERROR] Failed to parse GraphicsCommand command payload with error: base64 encoded data must have a length that is a multiple of four
[182 03:53:43.767389] [PARSE ERROR] DCS sequence contained non-printable character: 0xd ignoring the sequence
[182 03:53:43.767397] [PARSE ERROR] DCS sequence contained non-printable character: 0xa ignoring the sequence
[182 03:53:43.767401] [PARSE ERROR] DCS sequence contained non-printable character: 0x1b ignoring the sequence
[182 03:53:56.050808] [PARSE ERROR] Unrecognized DCS code: 0x7a
[182 03:53:56.050828] [PARSE ERROR] Unknown CSI code: 'm' with start_modifier: '' and end_modifier: '%' and parameters: '0'
[182 03:54:05.443304] [PARSE ERROR] Failed to parse GraphicsCommand command payload with error: output buffer too small
[182 03:54:05.448849] [PARSE ERROR] Unknown char after ESC: 0x5c
[182 03:54:06.462808] [PARSE ERROR] DCS sequence contained non-printable character: 0x1b ignoring the sequence
[182 03:54:41.494616] [PARSE ERROR] Unrecognized DCS code: 0x7a
[182 03:54:41.494636] [PARSE ERROR] Unknown CSI code: 'm' with start_modifier: '' and end_modifier: '%' and parameters: '0'

i've got a reproduction case attached. run it, and you'll see this problem (i suspect). comment out the sleep, and echo is still slow enough that i trigger the behavior regularly. remove the synchronized update, and things work fine, even with the sleep:

bug.txt

This was first noticed in dankamongmen/notcurses#1864

124082882-39957380-da1b-11eb-9896-32814ed8b1b7

@dankamongmen
Copy link
Contributor Author

ugh, it opened up by accident. filling in now...

@dankamongmen
Copy link
Contributor Author

here's the output of my repro case with 0.21.2:

[schwarzgerat](130) $ ~/bug.txt 
/P/8VPz//FT8//xU/P/8VPz//FT8//xU/P/8VPz//FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FT8//xU/P/8VPz//FT8//xU+Pf8VPj3/FTw8/xQ8PP8UOzr/FTs6/xM5Of8TODf/ETg3/xI2Nv8SNTT/ETMz/xEyMf8QMDD/ETAw/xAvLv8PLS3/DCwr/w4qKv8OKSj/DCcn/w0mJf8MJCT/DCMi/wshIf8LIB//CCAf/woeHv8KHh7/CB0c/wkbG/8JGxv/CBsb/wkaGf8JGhn/CBoZ/wkaGf8JGhn/CBoZ/x9cW/8zmZj/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Si/zekov83pKL/N6Gf/4TW1f+q4+L/puHg/6Lg3/9Lw8L/gNXT/xhHRv8SNTT/ETU0/xI1NP8SNjb/ETY2/xI2Nv8SNjb/ETg3/xM4N/8TODf/ETg3/xM5Of8TOTn/ETk5/xQ7Ov8UOzr/FTw8/xQ8PP8UPDz/FT49/xU+Pf8VPj3/FT49/xU/P/8VPz//FT8//xU/P/8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZCQf8WQUD/FTw8/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf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/zWfnv8FDg3/BA4N/wUPD/8FDw//BA8P/wYREP8GERD/BBIS/wYSEv8HFBP/BBQT/wcVFf8IFxb/CBgY/wgYGP8JGhn/CBsb/wodHP8KHh7/CCAf/wshIf8MIyL/DCYl/w0nJ/8OKSj/DCoq/w8sK/8PLS3/ETAw/xEyMf8RMzP/O6in/37U0/9+1NP/f9TT/zqurf8UOzr/FTs6/xQ8PP8VPj3/FT49/xU+Pf8VPz//FT8//xU/P/8VPz//FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUJB/xZCQf8WQkH/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8WQUD/FUFA/xZBQP8VPz//FT8//xU/P/8VPz//[schwarzgerat](0) $ 

@kovidgoyal
Copy link
Owner

Thanks, I can repro with that, I will look into it when I have a little uniterrupted time.

@kovidgoyal
Copy link
Owner

The issue was present with both timeout and total size exceeding 1MB, your test case triggerred both :) Now fixed. But I definitely recommend you not transmit large image data inside an ASU sequence, as that will easily overflow the 1MB buffer.

@dankamongmen
Copy link
Contributor Author

The issue was present with both timeout and total size exceeding 1MB, your test case triggerred both :) Now fixed. But I definitely recommend you not transmit large image data inside an ASU sequence, as that will easily overflow the 1MB buffer.

awesome, thanks for the quick fix. i will move to the load+PUT sequence you recommended over in the Notcurses bug, and that ought fix my issues. at that point, the value proposition for ASU drops pretty steeply for me. i'll probably turn it back on, though, since you're responding to 2026.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Jul 1, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants