fix: Guard getTransport() call in setTransaction for GCC.#151
Merged
20001020ycx merged 1 commit intoy-scope:release-0.297-edge-10-clp-connectorfrom Mar 6, 2026
Conversation
GCC generates incorrect code in Release mode (-O3) for txn_->getTransport().getCodec().getProtocol() in setTransaction(), causing SIGSEGV at address 0x0 during worker-to-coordinator HTTP connection. This is the same class of bug as prestodb#22995. The existing fix (PR prestodb#23531) only guarded the createTransaction() code path. This applies the same #if defined(__clang__) pattern to the setTransaction() code path added in the 0.297 integration. The protocol_ field is std::optional and only used for a VLOG(2) debug log in onHeadersComplete(), so skipping the assignment on GCC has no functional impact.
📝 WalkthroughWalkthroughThis change adds compiler-specific conditional guards in the HTTP client code to prevent segmentation faults on GCC builds. Two code paths are now restricted to clang-only execution: protocol retrieval in ResponseHandler::setTransaction and an event-base thread safety check in idle session handling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jackluo923
approved these changes
Mar 6, 2026
3 tasks
ba677bc
into
y-scope:release-0.297-edge-10-clp-connector
15 of 16 checks passed
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.
Description
See #152 for complete background.
GCC generates incorrect code in Release mode (-O3) for
txn_->getTransport().getCodec().getProtocol()in setTransaction(), causing SIGSEGV at address 0x0 during worker-to-coordinator HTTP connection. This is the same class of bug as prestodb#22995.The existing fix (PR prestodb#23531) only guarded the createTransaction() code path. This applies the same #if defined(clang) pattern to the setTransaction() code path added in the 0.297 integration.
The protocol_ field is std::optional and only used for a VLOG(2) debug log in onHeadersComplete(), so skipping the assignment on GCC has no functional impact.
Checklist
breaking change.
Validation performed
E2E Testing Infra:
Built both Docker images locally from a branch combining the SIGSEGV fix (this PR) and the CLP plugin packaging fix (#149), using the same build steps and args as CI:
E2E Test
Started coordinator and worker containers using the locally built images with the existing docker-compose.yaml deployment configuration.
The below query returns expected result
Summary by CodeRabbit