Skip to content

Directory walkers: don't crash on symlinks / unreadable entries (OF #8545) - #667

Merged
danoli3 merged 1 commit into
openframeworks:masterfrom
danoli3:fix-symlink-walkers
Oct 16, 2026
Merged

danoli3 merged 1 commit into
openframeworks:masterfrom
danoli3:fix-symlink-walkers

Conversation

@danoli3

@danoli3 danoli3 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Refs openframeworks/openFrameworks#8545

PG crashes with no message when it hits an addon directory it can't stat/iterate. On Windows that shows up as 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN) because MSVC's abort() after an uncaught exception uses __fastfail; on macOS/Linux it's libc++abi: terminating due to uncaught exception ... filesystem_error (exit 134).

Changes

  • Directory walkers no longer throw on bad entries — error_code overloads / cached directory_entry type, skip_permission_denied, increment(ec):
    • getFilesRecursively (x2), getPropsRecursively, dll walker, getFoldersRecursively, getLibsRecursively, dirList, folderList, containsSourceFiles (Utils.cpp)
    • ofAddon::getFrameworksRecursively
  • main wraps generation in try/catch and prints the exception (and filesystem_error paths) via messageError instead of aborting, so any remaining case says which file it was.

Tested (macOS, addon with dylib version symlinks + extras)

addon contents master osx / vs this PR osx / vs
.dylib version symlinks (issue layout) 0 / 0 0 / 0
+ dangling symlink, directory symlink 0 / 0 0 / 0
+ symlink cycle (libs/loop -> ..) 134 / 134 (Too many levels of symbolic links) 0 / 0
+ unreadable directory 134 / 134 (Permission denied) 0 / 0

Generated vcxproj / xcodeproj still contain the addon sources, avcodec.lib, and all dylibs; dangling link skipped.

The exact Windows trigger from the issue (valid file symlinks only) doesn't reproduce on macOS, so it still needs a re-test on Windows with -a ofxHapPlayer — if anything still throws it will now print the path instead of a silent 0xC0000409.

…rt uncaught exceptions instead of abort (#8545)
@danoli3
danoli3 merged commit a92556b into openframeworks:master Oct 16, 2026
5 checks passed
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.

1 participant