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] GEF runs my shell for spawning commands like clear #1147

Open
1 of 9 tasks
liferooter opened this issue Oct 30, 2024 · 0 comments · May be fixed by #1148
Open
1 of 9 tasks

[Bug] GEF runs my shell for spawning commands like clear #1147

liferooter opened this issue Oct 30, 2024 · 0 comments · May be fixed by #1148
Assignees
Labels
bug low-priority ui Anything related to GEF's appearance

Comments

@liferooter
Copy link

liferooter commented Oct 30, 2024

GEF+GDB version

GEF: (Standalone)
Blob Hash(/nix/store/qd13yw7mg6kfcgp5h0vk01byyssmbd3f-gef-2024.06/share/gef/gef.py): c713c62efd950a24413b0834d9e8fd3563ba114f
SHA256(/nix/store/qd13yw7mg6kfcgp5h0vk01byyssmbd3f-gef-2024.06/share/gef/gef.py): 12881b1d42fb490ca72896099daf5c128c7c7382be0779c8f8f7db3a9161ab6f
GDB: 15.1
GDB-Python: 3.12

Operating System

NixOS Linux

Describe the issue you encountered

To clear screen, GEF runs clear command in my SHELL . This behavior is unexpected because

  • clear that is expects is a binary from ncurses and can be looked up from PATH without involving my shell
  • nobody guarantees GEF that my shell is POSIX-compatible and things it do with my shell will work
  • nobody guarantees GEF that clear command from my shell with my random environment is clear it expects. In my case it's Nushell's built-in which has different set of flags, so GEF breaks trying to run it.

That's because GEF supposes using GDB's shell command to be acceptable, which is obviously invalid, because GDB's shell command runs binary it knows nothing about (which is my shell) as it's Bash, which is invalid behavior by definition, but obviously won't be fixed in near future because it will break backward compatibility of GDB. For running guaranteed POSIX-compatible shell people have their /bin/sh.

Do you read the docs and look at previously closed issues/PRs for similar cases?

Yes

Architecture impacted

  • X86
  • X64
  • ARM
  • ARM64
  • MIPS
  • MIPS64
  • PPC
  • PPC64
  • RISCV

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

  • Install Nushell as your default shell
  • Run GEF
  • Setup any layout with views. In my case it was done by gef config context.layout "regs code" and running the program.
  • Encounter the issue because clear in Nushell doesn't have -x flag

Minimalist test case

Not applicable. The issue is obviously testable with any code.

Additional context?

Nushell's error as a witness that thing broke:

Error: nu::parser::unknown_flag

  × The `clear` command doesn't have flag `-x`.
   ╭─[source:1:8]
 1 │ clear -x
   ·        ┬
   ·        ╰── unknown flag
   ╰────
  help: Available flags: --help(-h), --all(-a). Use `--help` for more information.
@hugsy hugsy linked a pull request Oct 30, 2024 that will close this issue
4 tasks
@hugsy hugsy self-assigned this Oct 31, 2024
@hugsy hugsy added low-priority ui Anything related to GEF's appearance and removed triage labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug low-priority ui Anything related to GEF's appearance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants