[SERVER-39879] Fix unique_function constructor selection issues Created: 27/Feb/19 Updated: 29/Oct/23 Resolved: 27/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Benjamin Caimano (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Dev Tools 2019-03-25, Dev Tools 2019-04-08, Dev Tools 2019-04-22, Dev Tools 2019-06-03, Dev Tools 2019-07-01 |
| Participants: |
| Description |
|
It appears that code of the following form segfaults due to recursion
This appears to be due to the fact that the unique_function ctor resolves to have a non-const lvalue reference parameter of unique_function, which is valid because of the templated ctor. |
| Comments |
| Comment by Benjamin Caimano (Inactive) [ 27/Jun/19 ] |
|
Closing this issue on request. If you run into the is_constructible related issues described in these comments, please submit a follow-on ticket. |
| Comment by Githook User [ 27/May/19 ] |
|
Author: {'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}Message: |
| Comment by A. Jesse Jiryu Davis [ 21/May/19 ] |
|
Should this be assigned to adam.martin again for merging? |
| Comment by Benjamin Caimano (Inactive) [ 13/Mar/19 ] |
|
Apparently, there is an additional related issue wherein there are compilation issues when using is_constructible<unique_function<>>. This seems to come from the ordering of enable_if statements in the templated ctor. Essentially, when resolving __is_move_constructible we hit the template and attempt to use is_move_constructible. (See godbolt concept example here.) It appears that the current order is:
|