Skip to content

Fix FSEvents CoreFoundation path arrays - #14726

Merged
rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-wqrozqmxpukx
May 25, 2026
Merged

rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-wqrozqmxpukx

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

Build the CoreFoundation array of watched paths with CFArrayAppendValue instead of setting indexes in an initially empty array. The old code relied on invalid indexed insertion and could crash when creating streams, especially with multiple watched paths.

Release each temporary CFString after appending it to avoid leaking CoreFoundation references, and add a macOS regression test for watching multiple paths in one stream.

Build the CoreFoundation array of watched paths with CFArrayAppendValue
instead of setting indexes in an initially empty array. The old code
relied on invalid indexed insertion and could crash when creating
streams, especially with multiple watched paths.

Release each temporary CFString after appending it to avoid leaking
CoreFoundation references, and add a macOS regression test for watching
multiple paths in one stream.

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg
rgrinberg merged commit aa933ee into ocaml:main May 25, 2026
29 checks passed
@Alizter Alizter added this to the 3.25.0 milestone Jul 8, 2026
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.

2 participants