Conversation
…tomExtensionProperties Prevent SIGSEGV (signal SIGSEGV: segmentation violation code=0x2 addr=0x8) caused by deleting Object.kvs entries while Visit() iterates over them. Instead of calling Del() in the Visit callback, rebuild the extensions object with only allowed keys. This approach is also zero-allocation when iterating allowedErrorExtensionFields. Also simplify optionallyOmitErrorExtensions by removing redundant Exists() check before Del() since Del() is a safe no-op on missing keys. - Add 3 new tests providing 100% coverage of optionallyAllowCustomExtensionProperties - Verify existing tests pass Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThis PR refactors error extension field handling in the GraphQL engine's loader component. It changes the extension filtering logic to either completely remove the extensions object when no fields are allowed or construct a new filtered extensions object with only permitted fields, replacing the previous in-place modification approach. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
jensneuse
added a commit
to wundergraph/cosmo
that referenced
this pull request
Feb 20, 2026
Fix mutation-during-iteration SIGSEGV in optionallyAllowCustomExtensionProperties. Upstream PR: wundergraph/graphql-go-tools#1402 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jensneuse
pushed a commit
that referenced
this pull request
Feb 21, 2026
🤖 I have created a release *beep* *boop* --- ## [2.0.0-rc.255](v2.0.0-rc.254...v2.0.0-rc.255) (2026-02-21) ### Bug Fixes * **resolve:** fix mutation-during-iteration bug in optionallyAllowCustomExtensionProperties ([#1402](#1402)) ([4c4bfc8](4c4bfc8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Bug Fixes * Fixed a mutation-during-iteration bug in v2.0.0-rc.255 ## Chores * Updated release version <!-- end of auto-generated comment: release notes by coderabbit.ai -->
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix SIGSEGV (segmentation violation at addr=0x8) caused by deleting
Object.kvsentries whileVisit()iterates over them. This occurred inoptionallyAllowCustomExtensionPropertieswhen filtering extension fields.Changes
Visitcallback, rebuild extensions with only allowed keysoptionallyOmitErrorExtensionsby removing redundantExists()check beforeDel()(Del is a safe no-op on missing keys)Test Coverage
All tests pass, including 3 new tests covering previously uncovered branches:
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests