Skip to content

[Bug] 'gef-remote' failed to execute properly, reason: [Errno 17] File exists #1128

@Cnly

Description

@Cnly

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions