GH-50930: Prevent symbol interposition in arrow_s3fs - #50949
Open
tadeja wants to merge 1 commit into
Open
Conversation
|
|
tadeja
marked this pull request as ready for review
August 24, 2026 19:30
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes ELF symbol interposition that could cause arrow_s3fs to reuse finalized S3 state from libarrow.
Changes:
- Makes the S3 filesystem registrar local.
- Detects linker support and applies
-Bsymbolic-functionstoarrow_s3fs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cpp/src/arrow/filesystem/s3fs.cc |
Localizes the S3 registrar. |
cpp/src/arrow/CMakeLists.txt |
Applies symbolic function binding to the S3 module. |
cpp/CMakeLists.txt |
Detects linker support for the required option. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Isn't that the actual problem? I don't think we should compile the same file twice. @raulcd |
Member
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.
Rationale for this change
Fix #50930
Actual: "Invalid: Attempt to initialize S3 after it has been finalized"[ FAILED ] S3Test.FromUriRejectsUnknownOptions (0 ms)Both
libarrow.soand dynamically loadedlibarrow_s3fs.socompiles3fs.cc, so both libraries get own S3 state and filesystem registration callbacks.The S3 module tests finalize the state in
libarrow.sobefore loadinglibarrow_s3fs.so. ELF symbol interposition causeslibarrow_sf3s.soreferences to bind to definitions inlibarrow.so, so the module incorrectly reuses its finalized state.LD_DEBUG=bindings example output (for symbol arrow::fs::kS3FileSystemModule):
These duplicate definitions were present before, but the issue was masked by
-fvisibility-inlines-hiddenby conda-forgecompilers 1.11(with gcc 14.4).Now with conda-forge
compilers 2.0there is no-fvisibility-inlines-hiddenanymore, minimally activated as described in conda-forge/conda-forge.github.io#2595.What changes are included in this PR?
Link
arrow_s3fswith-Wl,-Bsymbolic-functionsso its function references bind locally,and make
kS3FileSystemModulestatic so it's not exported.Are these changes tested?
Yes,
S3Test.FromUriRejectsUnknownOptionspasses.Are there any user-facing changes?
No.