fix(geomodel): also hide std::__format vtables/typeinfo from exports#18
Merged
Conversation
PR #17 added `-Wl,--version-script={local: _ZNSt8__format*;}` which hid `_ZN…`-mangled function symbols. Local audit confirmed 0 weak `_ZN` exports per geomodel lib. But CI debug PR (ShipSoft/Geometry#29) captured a backtrace showing the crash is still in libGeoModelWrite: Program received signal SIGSEGV #0 std::__format::_Sink<char>::_M_write(…) from libGeoModelWrite.so.6 #1 std::__format::_Formatting_scanner<…>::_M_on_chars(…) from libGeoModelWrite.so.6 #2 std::__format::_Scanner<char>::_M_scan(…) at <format>:3942 … #7 SHiPGeometry::CalorimeterFactory::buildStack(…) at CalorimeterFactory.cpp:184 `nm -D libGeoModelWrite.so.6 | grep __format` still shows 15 entries (all `V` vague-linkage) for vtables (`_ZTV…`), typeinfo (`_ZTI…`), and typeinfo names (`_ZTS…`) of _Sink<char>, _Buf_sink, _Fixedbuf_sink, _Seq_sink<string>, _Scanner, _Formatting_scanner. Those are not matched by `_ZNSt8__format*` (they start with `_ZTV`/`_ZTI`/`_ZTS`, not `_ZN`), so build_geometry's `_Seq_sink<string>` constructor still binds its vptr to libGeoModelWrite's vtable, and the virtual call lands in libGeoModelWrite's compiled-with-different-headers `_M_write`. Broaden the version script pattern to `*NSt8__format*` so vtables, typeinfo, typeinfo names, and any future nested std::__format symbols all get localized. Bump build.number to 4.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refines the geomodel recipe's linker version script to hide ChangesGeomodel symbol hiding and build metadata
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
olantwin
added a commit
to ShipSoft/Geometry
that referenced
this pull request
Jun 5, 2026
ShipSoft/ship-conda-recipes#18 broadened the linker version script to `*NSt8__format*` so std::__format vtables, typeinfo, and typeinfo names are localized along with the function symbols PR #17 already hid. Local symbol audit now reports 0 V|W St8__format exports in all four affected geomodel libs (was 0 W but 15 V on build 3), and the full test suite passes 25/25 in this environment.
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
_ZNSt8__format*(functions only) to*NSt8__format*(functions + vtables + typeinfo + typeinfo names + any future std::__format mangling).recipes/geomodel/recipe.yamlbuild.numberto4.Why
PR #17 (
_3) hid_ZN…-mangledstd::__formatfunctions and the local symbol audit went 4 → 0 weak_ZNexports per geomodel library. But ShipSoft/Geometry's PR #26 CI still crashes. PR #29 added agdb --batchstep to the failing workflow and captured this backtrace from run 27018773426:Why round 3 didn't fix it:
nm -D libGeoModelWrite.so.6 | grep __formaton the rebuilt_3artifact still shows 15V(vague-linkage) entries:The
_ZNSt8__format*glob doesn't match those — they start with_ZTV/_ZTI/_ZTS, not_ZN. Sobuild_geometry's stack-allocated_Seq_sink<std::string>constructor still binds itsvptrto libGeoModelWrite's exported vtable (libGeoModelWrite is first inDT_NEEDED), the virtual call dispatches into libGeoModelWrite's compiled-with-different-headers_M_write, and the class layout mismatch crashes.*NSt8__format*matches the mangled namespace prefix wherever it appears in the symbol — functions (_ZN…NSt8__format…), vtables (_ZTVNSt8__format…), typeinfo (_ZTINSt8__format…), typeinfo names (_ZTSNSt8__format…). Each consumer .so keeps its own internally-emitted copies, ABI-consistent with the headers it was compiled against, and no cross-library vptr resolution happens.Test plan
geomodel 6.27.0 hb0f4dca_4to channelshipV|WSt8__formatexports perlibGeoModelXml/Write/Read/DBManager.so.6(round 3 had 0 W but 15 V; round 4 must zero both)if: failure()gdb step from PR ci: add weekly channel snapshot workflow #29 doesn't fireSummary by CodeRabbit