contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.43k stars 105 forks source link

contour locked up when I catted a file of unknown (binary!) contents #1062

Open cqexbesd opened 1 year ago

cqexbesd commented 1 year ago

Contour Terminal version

0.3.11-master-cd0aa937

Installer source

Github: source code cloned

Operating System

Arch Linux as of approx a week ago

Architecture

x86-64

Other Software

No response

Steps to reproduce

I cat'ed a file and I have no idea whats in there. I will try to save the file if I can but its not as simple as you might think.

Expected Behavior

something to appear on my screen

Actual Behavior

contour stopped responding. the mouse cursor disappears when inside the window. The window does redraw however. strace says it is constantly reading WW...not sure where that's coming from but see attached.

contour.strace.txt contour.lsof.txt

Additional notes

contour is taking over 100% of CPU time, not unsurprisingly.

Yaraslaut commented 1 year ago

If you can not save the file that we can use to reproduce this behavior, output of contour debug all will help a lot Can be related to https://github.com/contour-terminal/contour/issues/980

Yaraslaut commented 1 year ago

Here is example of a file which will crash contour crash.txt

tail -n 20 crash.txt is enough also head -n 10 crash.txt shows weird behavior as well

Utkarsh-khambra commented 1 year ago

tail -n 20 crash.txt is enough

~This file doesn't crash contour for me.~ I should've checked with debug build, now it crashes.

christianparpart commented 1 year ago

Yeah i started working on this and u think I only fixed the lockup (in a branch), but what is missing is proper handling of arbitrary binary (invalid utf-8) data. This requires sissy a Twitter in libunicode sich I didn't finish yet