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-remote' failed to execute properly, reason: [Errno 17] File exists #1128

Open
1 of 9 tasks
Cnly opened this issue Sep 3, 2024 · 1 comment
Open
1 of 9 tasks

Comments

@Cnly
Copy link

Cnly commented Sep 3, 2024

GEF+GDB version

GEF: (Standalone)
Blob Hash(/home/parallels/.gef-2024.06.py): 88981e223320723f9df39bd8714ea2d56da4dbee
SHA256(/home/parallels/.gef-2024.06.py): 764738509912bea65f67927691d5fa0421444d1969678208095733fdbf0dd83d
GDB: 15.1
GDB-Python: 3.12

Operating System

Kali Linux

Describe the issue you encountered

When I try to use gef-remote --qemu-user --qemu-binary ~/Desktop/<executable> localhost 1234, the command fails with the error

[!] Command 'gef-remote' failed to execute properly, reason: [Errno 17] File exists: '/tmp/tmp_k7juwvp/home/parallels/Desktop'

which seems to be a result of this exist_ok=False flag:

gef/gef.py

Line 11481 in 1b6f46a

target.mkdir(parents=True, exist_ok=False)

I also tested with the main branch (674c74d) and the problem still exists. Setting the flag to True solves the problem. If this is the correct fix, I'm happy to open a PR from my fork.

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.

  1. Compile the minimalist test case.
  2. Run it with qemu-arm64 -g 1234 a.out
  3. gdb-multiarch -ex 'gef-remote --qemu-user --qemu-binary /path/to/a.out localhost 1234'

Minimalist test case

// compile with gcc -fPIE -fpic a.c
int main(){ return 0; }

Additional context?

No response

@ValekoZ
Copy link
Collaborator

ValekoZ commented Sep 7, 2024

Why does this directory already exists? If it's a correct behavior to mkdir this directory multiple times, then I guess your fix should be good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants