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

Crash when PM (privacy message) sequence is output #513

Closed
j4james opened this issue Nov 19, 2021 · 5 comments · Fixed by #517
Closed

Crash when PM (privacy message) sequence is output #513

j4james opened this issue Nov 19, 2021 · 5 comments · Fixed by #517
Labels
bug Something isn't working crash(-like) Bug that results in severe state corruption, lock-ups with recovery, or outright termination VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@j4james
Copy link

j4james commented Nov 19, 2021

Description

If I output a simple PM sequence, Contour crashes with a std::out_of_range error.

Environment

  • Contour Version or Git commit hash: 0.3.0-unreleased
  • Operating System (name / distribution / version): Ubuntu 21.04
  • Contour configuration:
  • TERM environment variable: xterm-256color
  • Compiler version:

Steps to Reproduce

From a bash shell execute the following:

printf "\e^X"

Contour crashes with the following error message:

terminate called after throwing an instance of 'std::out_of_range'
  what():  array::at: __n (which is 15) >= _Nm (which is 15)
Aborted (core dumped)
@j4james
Copy link
Author

j4james commented Nov 19, 2021

It looks like an SOS (start of string) sequence will trigger it too:

printf "\eXY"

@christianparpart
Copy link
Member

Oh nice catch. I know I was simply mapping the DEC VT parser FSM and later on improved on it a bit.

I never touched PM, so I tried to google a bit about it but severely failed. What did you use/test it for? How can I find out more about PM? (just read your SOS comment, will investigate).

@j4james
Copy link
Author

j4james commented Nov 20, 2021

This wasn't an app or anything like that. I was just running some random string sequence tests on the terminals I have installed to see how different implementations handle them. I doubt anyone is likely to be using these sequences for real, so there's no urgency to fix this.

@j4james
Copy link
Author

j4james commented Nov 20, 2021

How can I find out more about PM?

If you look at that state diagram, you can see that PM and SOS should be handled exactly the same way as APC (which doesn't seem to have this problem).

@christianparpart
Copy link
Member

yes, I was splitting something apart I can remember. Before I'm getting the "it's not working"-label, I better fix that (over the weekend).

Many thanks for the report @j4james :)

@christianparpart christianparpart added bug Something isn't working stability VT: Backend Virtual Terminal Backend (libterminal API) labels Nov 20, 2021
@whisperity whisperity added the crash(-like) Bug that results in severe state corruption, lock-ups with recovery, or outright termination label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash(-like) Bug that results in severe state corruption, lock-ups with recovery, or outright termination VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants