[SERVER-68140] Expose object_check.h to query_analysis.cpp Created: 19/Jul/22  Updated: 29/Oct/23  Resolved: 02/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Spencer Jackson Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-49322 Evaluate feasibility and impact of en... Closed
Backwards Compatibility: Fully Compatible
Sprint: Security 2022-07-25, Security 2022-08-08
Participants:
Linked BF Score: 5

 Description   

fle_crypto.h exposes an inline function called parseFromCDR which consumes a Validated<BSONObj> out of a ConstDataRange. The Validated<BSONObj> type requires a template specialization which is provided from rpc/object_check.h. In order to make this invocation work, either every caller of parseFromCDR must have access to the symbols for the template specialization.

These symbols are provided by including object_check.h into fle_crypto.cpp.However, when using fvisibility-inlines-hidden, the symbols are hidden from the shared object's export table.



 Comments   
Comment by Githook User [ 20/Jul/22 ]

Author:

{'name': 'Spencer Jackson', 'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson'}

Message: SERVER-68140 Expose object_check.h to query_analysis.cpp
Branch: master
https://github.com/mongodb/mongo/commit/dde2da6957cfae58d50a53229b5795aa1bbc1cf5

Comment by Spencer Jackson [ 19/Jul/22 ]

Building with fvisibility-inlines-hidden results in this message:

[407/628 ( 64%) 4.691s] Linked build/ninja/mongo/db/modules/enterprise/src/fle/query_analysis/libquery_analysis.so
FAILED: build/ninja/mongo/db/modules/enterprise/src/fle/query_analysis/libquery_analysis.so
export CCACHE_NOCPP2='1';export CCACHE_PREFIX='/home/ubuntu/mongo/build/scons/icecream/ninja/run-icecc.sh';export ICECC_CLANG_REMOTE_CPP='1';export PATH='/opt/mongodbtoolchain/v4/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin';/usr/bin/icerun /opt/mongodbtoolchain/v4/bin/clang++ @build/ninja/mongo/db/modules/enterprise/src/fle/query_analysis/libquery_analysis.so.rsp
ld.lld: error: undefined symbol: mongo::Validator<mongo::BSONObj>::validateLoad(char const*, unsigned long)
>>> referenced by data_type_validated.h:102 (src/mongo/base/data_type_validated.h:102)
>>>               build/ninja/mongo/db/modules/enterprise/src/fle/query_analysis/query_analysis.dyn.o:(mongo::StatusWith<mongo::Validated<mongo::BSONObj> > mongo::ConstDataRangeCursor::readAndAdvanceNoThrow<mongo::Validated<mongo::BSONObj> >())
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
[416/628 ( 66%) 4.790s] Linked build/ninja/mongo/db/repl/libtenant_migration_utils.so

Generated at Thu Feb 08 06:10:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.