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

Refactor: Restore serial settings for incorrect serial #1214

Merged

Conversation

alessandrocarminati
Copy link
Contributor

When using a utility on a board and running it via a serial console, an issue arises where the output becomes corrupted after executing a command, rendering the terminal unusable.
Analyzing the strace output reveals that the code responsible for backing up the serial connection settings from the console's file descriptor restores them to file descriptor 0 instead of the intended console's file descriptor.

This circumstance leads to the problem at hand.

The proposed fix resolves this issue by addressing the aforementioned scenario.

When using a utility on a board and running it via a serial console, an
issue arises where the output becomes corrupted after executing a command,
rendering the terminal unusable.
Analyzing the strace output reveals that the code responsible for backing
up the serial connection settings from the console's file descriptor
restores them to file descriptor 0 instead of the intended console's file
descriptor.

This circumstance leads to the problem at hand.

The proposed fix resolves this issue by addressing the aforementioned
scenario.

Signed-off-by: Alessandro Carminati <[email protected]>
Signed-off-by: Alessandro Carminati <[email protected]>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit ec06899 into containers:main May 15, 2023
@NilsIrl
Copy link
Contributor

NilsIrl commented Aug 10, 2024

After this change, what is the purpose of the libcrun_setup_terminal_ptmx function? it seems to just get the parameters and then set them without changing anything.

@NilsIrl NilsIrl mentioned this pull request Aug 10, 2024
NilsIrl added a commit to NilsIrl/crun that referenced this pull request Aug 20, 2024
Since containers#1214 it is a no-op and
does nothing more than call set_raw.

Signed-off-by: Nils <[email protected]>
NilsIrl added a commit to NilsIrl/crun that referenced this pull request Aug 20, 2024
Since containers#1214 it is a no-op and
does nothing more than call set_raw.

Signed-off-by: Nils <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants