[SERVER-43371] Break up some tests to fix -fvar-tracking-assignments note. Created: 18/Sep/19 Updated: 29/Oct/23 Resolved: 06/Jan/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.3 |
| Type: | Task | Priority: | Trivial - P5 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Dev Tools 2020-01-13 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
This annoyance affects every build `all`. The function that's getting too big and throwing the compiler message is `__static_initialization_and_destruction_0(int,int)`. This grows with the # of namespace-scope objects, and in these cases that's going to be the objects defined by TEST and TEST_F macros. I think that if these massive files were simply broken up the problem would go away.
As part of this ticket we should look to see whether we can make fvar-tracking-assignments trigger a compiler error rather than a warning. |
| Comments |
| Comment by Githook User [ 06/Jan/20 ] | |||||
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: | |||||
| Comment by Billy Donahue [ 02/Jan/20 ] | |||||
|
It's a subtle thing having to do with the optimizer keeping annotations about data flow through a function, in this case, through the hidden function that initializes all the statics in these large test files. The more TEST/TEST_Fs, the more statics, and the more little std::strings to track. Changing the unittest::RegistrationAgent to be StringData based instead of std::string based does the trick. The annotation note is only emitted at a threshold somewhere between 1000 and 5000 TEST_Fs, rather than just 114 of them. https://mongodbcr.appspot.com/527400020/
| |||||
| Comment by James Wahlin [ 02/Jan/20 ] | |||||
|
I wonder if something changed to make this more restrictive? After fixing a few of the tests earlier the only one I saw failing was transaction_router_test.cpp. mutable_bson_test.cpp has not changed since June 14th 2019, which was before these efforts. | |||||
| Comment by Billy Donahue [ 02/Jan/20 ] | |||||
|
The magic number seems to be 114. Tested by a trivial suite consisting only of trivial tests...
| |||||
| Comment by Billy Donahue [ 02/Jan/20 ] | |||||
|
This seems to have gotten much worse again since the initial reporting. $ grep tracking-assignments build.out | cut -d: -f1-2
| |||||
| Comment by Nicholas Zolnierz [ 04/Oct/19 ] | |||||
|
billy.donahue is the full list in the description? Surprised to see expression_test.cpp didn't make the cut, we have | |||||
| Comment by Billy Donahue [ 04/Oct/19 ] | |||||
|
That's great news, James. Thanks. | |||||
| Comment by James Wahlin [ 04/Oct/19 ] | |||||
|
The Query team has created | |||||
| Comment by Sara Williamson [ 23/Sep/19 ] | |||||
|
We'd like to find a compiler flag that would make this a hard error. |