[SERVER-42042] Warn or fail early on dynamic builds with toolchain compiler and tcmalloc Created: 02/Jul/19  Updated: 29/Oct/23  Resolved: 24/Oct/19

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.3.1, 4.0.20, 4.2.9, 3.6.20

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
causes SERVER-49925 Dynamic builders should not combine t... Closed
Related
related to SERVER-27675 tcmalloc must be explicitly linked by... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2, v4.0, v3.6
Sprint: Dev Tools 2019-07-29, Dev Tools 2019-08-12, Dev Tools 2019-09-23, Dev Tools 2019-10-07, Dev Platform 2019-11-04
Participants:

 Description   

It's tempting for MongoDB developers to use --link-model=dynamic to skip the slow link step when building the server. However, it's natural to also use tcmalloc (the default), the mongodbtoolchain compiler, and --dbg=on. This leads the server to crash with "memory allocation/deallocation mismatch", which is difficult to diagnose (SERVER-27675).

To save developers from a frustrating investigation, SCons should fail if it detects this combination of flags. Perhaps the rule is enforced within files like mongodbtoolchain_v3_gcc.vars and its family.



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

Author:

{'name': 'Andrew Morrow', 'email': 'andrew.morrow@10gen.com'}

Message: SERVER-42042 Fail the build if it is set up to wander into the trilemma

(cherry picked from commit 25e8528e420bd128cd0f944aba37afce3907276e)
(cherry picked from commit 66073aa07b067efbf4b43b36d48585ad86a974da)
(cherry picked from commit 84f90b5c069fee0a84e62f91c284ddcb5dc10212)
Branch: v3.6
https://github.com/mongodb/mongo/commit/732df2fdc108f2125a9282ecb296283f58d57ac3

Comment by Githook User [ 14/Jul/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'andrew.morrow@10gen.com'}

Message: SERVER-42042 Fail the build if it is set up to wander into the trilemma

(cherry picked from commit 25e8528e420bd128cd0f944aba37afce3907276e)
(cherry picked from commit 66073aa07b067efbf4b43b36d48585ad86a974da)
Branch: v4.0
https://github.com/mongodb/mongo/commit/84f90b5c069fee0a84e62f91c284ddcb5dc10212

Comment by Githook User [ 14/Jul/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'andrew.morrow@10gen.com'}

Message: SERVER-42042 Fail the build if it is set up to wander into the trilemma

(cherry picked from commit 25e8528e420bd128cd0f944aba37afce3907276e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/66073aa07b067efbf4b43b36d48585ad86a974da

Comment by Githook User [ 24/Oct/19 ]

Author:

{'email': 'andrew.morrow@10gen.com', 'name': 'Andrew Morrow'}

Message: SERVER-42042 Fail the build if it is set up to wander into the trilemma
Branch: master
https://github.com/mongodb/mongo/commit/25e8528e420bd128cd0f944aba37afce3907276e

Comment by Eric Milkie [ 02/Jul/19 ]

Perhaps instead of warning/failing early, we can warn late, but with a more targeted message. All we need to do is change the error message text in src/third_party/gperftools-2.7/dist/src/debugallocation.cc and direct people to consider the trilemma ticket (SERVER-27675 or the google groups post).
We'd have to remember to update the text when we upgrade gperftools in the future.

Generated at Thu Feb 08 04:59:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.