[SERVER-43148] third_party/murmurhash layering violation Created: 04/Sep/19  Updated: 29/Oct/23  Resolved: 01/Oct/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Dev Tools 2019-09-23, Dev Tools 2019-10-07
Participants:

 Description   

third_party/murmurhash includes mongo/base and mongo/platform headers unnecessarily. It's doing this to access ConstDataView to get an unaligned endian swap.
Unfortunately that brings in a lot of mongo-specifics that can end up bringing in Abseil, and murmurhash isn't built with Abseil in its #include path.

So we're left with unwritten rules about which headers base and ConstDataView can include, or we can fix the layering violation in MurmurHash. I think we should inline the unaligned load and endian-swapping code into murmurhash since that's a pretty standard operation, and it's strange for a third_party library to reach out to mongo for support headers anyway.

I found this by adding stdx/unordered_map to base/init.h and getting a compile failure in murmurhash.



 Comments   
Comment by Githook User [ 01/Oct/19 ]

Author:

{'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}

Message: SERVER-43148 fix MurmurHash3 layering violation

Comment by Billy Donahue [ 20/Sep/19 ]

https://mongodbcr.appspot.com/483680002/

Comment by Billy Donahue [ 20/Sep/19 ]

A few more things that should be fixed at the same time while we're in there.

Dos2unix the source files.

Fix the unaligned writes.
(I just reported this upstream) https://github.com/aappleby/smhasher/issues/74

Hide undeclared symbols for helper functions in anonymous namespace.

Generated at Thu Feb 08 05:02:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.