[SERVER-70158] Fix undefined argument order for $atan2 in SBE Created: 03/Oct/22 Updated: 29/Oct/23 Resolved: 20/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.4, 6.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ivan Fefer | Assignee: | Adi Agrawal |
| 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: |
v6.1, v6.0
|
||||||||||||
| Sprint: | QE 2022-10-31 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
In SBE implementation for atan2 we extract arguments for atan2 in undefined order because _context->popExpr() is called several times as function argument: C++ doesn't specify the order of computation for function argument, so with any compiler upgrader and/or change in compilation flags this function can break. |
| Comments |
| Comment by Githook User [ 16/Nov/22 ] |
|
Author: {'name': 'Adityavardhan Agrawal', 'email': 'aa729@cornell.edu', 'username': 'Adityav369'}Message: (cherry picked from commit fb7df9a15a313857c87c1661cda126049fe410bf) |
| Comment by Githook User [ 20/Oct/22 ] |
|
Author: {'name': 'Adityavardhan Agrawal', 'email': 'aa729@cornell.edu', 'username': 'Adityav369'}Message: |
| Comment by Ivan Fefer [ 03/Oct/22 ] |
|
Also basic jstests for trigonometric expressions are not executed in SBE because they use $addFields: https://github.com/mongodb/mongo/blob/424befe581c9aeb29e42f05c0b1439ba2e39af98/jstests/aggregation/expressions/expression_trigonometric.js#L22 This should be fixed in this ticket to ensure that the fix is correct. |