Skip to content

BUG: Remove shared separator state from field IO - #151

Draft
blowekamp wants to merge 1 commit into
Kitware:masterfrom
blowekamp:fix-separator-data-race
Draft

blowekamp wants to merge 1 commit into
Kitware:masterfrom
blowekamp:fix-separator-data-race

Conversation

@blowekamp

Copy link
Copy Markdown
Collaborator

Remove shared separator state from MET_Read and MET_Write to eliminate a data race between calls using separate streams. Preserve the public API and add round-trip checks for default and custom separators.

Root Cause

Both entry points assigned their separator argument to one global variable, also read by MET_SkipToVal. Concurrent calls raced even with identical separators; different separators could corrupt parsing or output. Pass the separator directly to the helper instead.

Validation
  • Built the MetaIO library and testMeta1Utils with AppleClang in Debug mode.
  • testMeta1Utils passed, including round-trip checks for =, :, and |.
  • git diff --check passed.
  • No ThreadSanitizer run was performed.
AI Assistance

AI assistance was used to implement the change, add tests, and inspect repository history.

Concurrent field reads and writes race on the shared separator, even
when operating on separate streams. Keep the separator local to each
call and pass it explicitly to the parsing helper.
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