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

[BUG] when being attached by bpftime, bash will stuck if it spawns another bash process #289

Closed
Officeyutong opened this issue May 6, 2024 · 1 comment · Fixed by #295
Assignees
Labels
bug Something isn't working

Comments

@Officeyutong
Copy link
Contributor

Officeyutong commented May 6, 2024

Repdocuce:

  • cd examples/libbpf-tools/bashreadline && make
  • Terminal 1. bpftime load ./readline
  • Terminal 2. bpftime start /bin/bash --norc

Now everything works well. But if we run bash in the attached bash, it will stuck and won't handle any input, until a SIGINT (Ctrl+C) was sended

@Officeyutong Officeyutong added the bug Something isn't working label May 6, 2024
@Officeyutong Officeyutong self-assigned this May 6, 2024
@Officeyutong
Copy link
Contributor Author

Officeyutong commented May 13, 2024

Some initial investigations:

  • This might be related with logs printed by bpftime

Why?

If we run bpftime start /bin/bash --norc, everything works well. But if we run bash in the started shell, bash will stuck for a few seconds, prints bash: /usr/bin/dirname: Argument list too long and continues to stuck. And no logs will be printed for the new bash process.

So one guess is all logs printed by bpftime has gone to stdout, and they were eaten by a certain program that invokes bash (for example bash calls itself in bashrc), but that program was unable to process such unexpected stdout contents and just stuck.

If we still spawn bash with --norc in the spawned bash, everything still works well. So the key piece must be in some calls in bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant