Skip to content

Use non-throwing filesystem checks - #1165

Merged
xusheng6 merged 2 commits into
devfrom
test_container_file_crash
Aug 3, 2026
Merged

Use non-throwing filesystem checks#1165
xusheng6 merged 2 commits into
devfrom
test_container_file_crash

Conversation

@xusheng6

@xusheng6 xusheng6 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Switch unguarded fs::exists/canonical/remove/current_path calls to the std::error_code overloads so an inaccessible path (EACCES etc.) is treated as non-existent instead of terminating the process.

Fixes #1163
Fixes BINARYNINJA-HC

xusheng6 and others added 2 commits August 3, 2026 14:21
std::filesystem::exists and current_path throw filesystem_error when the
path is inaccessible (e.g. EACCES from posix_stat), which crashed the UI
when launching the debugger on a container file whose original path could
not be stat'ed. Switch to the std::error_code overloads so an
inaccessible path is treated as non-existent instead of terminating.

Fixes BINARYNINJA-HC

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same crash class as BINARYNINJA-HC: fs::exists, fs::canonical and
fs::remove throw filesystem_error when a path is inaccessible. Switch
the remaining unguarded call sites (WinDbg/TTD install and DbgEng path
validation) to the std::error_code overloads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@xusheng6
xusheng6 requested a review from plafosse August 3, 2026 18:44
@xusheng6
xusheng6 merged commit c8585ad into dev Aug 3, 2026
1 of 2 checks passed
@xusheng6
xusheng6 deleted the test_container_file_crash branch August 3, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when launching debugger on an inaccessible container file path

2 participants