[SERVER-45066] Crashes in AuthorizationManagerImpl when running binaries built with VS2019 Created: 11/Dec/19 Updated: 29/Oct/21 Resolved: 24/Jan/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Security |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||
| Sprint: | Security 2019-12-16, Dev Platform 2019-12-30, Dev Platform 2020-02-10 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
We have recently been doing experiments with building with VS2019, because it comes with a much faster linker. It can save us close to an hour of build time, the majority of which comes from faster linking of unit tests. However, we are encountering an interesting crash inside the AuthorizationManagerImpl class. Here are links to two recent instances out of a patch build:
The bottom of the crash always looks like:
So this might really be an issue with the InvalidingLRUCache, or with abseil, or it could be a VS2019 issue. CC shreyas.kalyan and jbreams. |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 15/Jan/20 ] |
|
MS released VS 2019 16.4.3, but it did not fix this issue. |
| Comment by Andrew Morrow (Inactive) [ 18/Dec/19 ] |
|
I have reported this issue upstream. |
| Comment by Shreyas Kalyan [ 12/Dec/19 ] |
|
In our InvalidatingLRUCache class, we are passing calling a function called _invalidateActiveIterator and passing in, among other things, an object of type ActiveIterator. ActiveIterator is an iterator of type ActiveMap::iterator, where ActiveMap is an abseil class absl::node_hash_map. At the bottom of the function, we are calling active_map::erase(iterator++) on the active map function. When calling this function, somehow the iterator increments and we end up passing the value ActiveMap::end as the parameter to the erase function. This seems to be a bug in MSVC 2019. The relevant code for our InvalidatingLRUCache can be found here: The relevant code in Abseil's classes (node_hash_map relies on base class raw_hash_map that relies on raw_hash_set) can be found here: When removing the iterator from the erase function, the tests that were previously failing are passing. |