[SERVER-48116] init-order bug inside pcrecpp Created: 11/May/20 Updated: 29/Oct/23 Resolved: 19/May/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| 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 | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.4
|
||||||||
| Sprint: | Service arch 2020-05-18, Service arch 2020-06-01 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 50 | ||||||||
| Description |
|
The fiasco is within pcrecpp. If we make an RE object too soon, it will reference some internal global state in the RE::Init pseudo-constructor, which might not yet be initialized. This benchmark is getting ProcessInfo at static init time, which gathers a lot of process metadata.
This call to getNumAvailableCores is the culprit. That function isn't currently safe at static init time. https://github.com/vmg/pcre/blob/master/pcrecpp.cc#L86
referring to this in a static initializer is an init-order fiasco trigger. |
| Comments |
| Comment by Githook User [ 19/May/20 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |
| Comment by Billy Donahue [ 19/May/20 ] |
| Comment by Billy Donahue [ 14/May/20 ] |
|
reopening to pursue better fix suggested by upstream bugzilla response. |
| Comment by Billy Donahue [ 14/May/20 ] |
|
Actually upstream suggested a simpler fix. The RE_Options is just three ints, initialized to zero. |
| Comment by Billy Donahue [ 13/May/20 ] |
|
Filed an upstream bug report https://bugs.exim.org/show_bug.cgi?id=2575 |
| Comment by Billy Donahue [ 13/May/20 ] |
|
It's not showing up here for some reason, but the backport to 4.4 is: |
| Comment by Githook User [ 13/May/20 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |
| Comment by Billy Donahue [ 11/May/20 ] |