tools/bashreadline: Fix bashreadline#4903
Merged
Merged
Conversation
Collaborator
|
Could you give more details about how to reproduce |
Contributor
Author
bashreadline1.mp4bashreadline2.mp4 |
123166d to
514013e
Compare
514013e to
87ceeda
Compare
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Nov 28, 2024
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup. At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline. The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.
Mic92
pushed a commit
to NixOS/nixpkgs
that referenced
this pull request
Jan 19, 2025
- we didn't provide the newly required elfutils python dependency, but we're only dealing with newer bashes so just use the new symbol - while here also default to using our libreadline as bash is configured to use it on nixos; this can still be overriden Link: iovisor/bcc#4903 Fixes: #328743
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Mar 18, 2025
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup. At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline. The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Oct 9, 2025
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup. At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline. The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup.
At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline.
The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.