[SERVER-77694] cannot compile `immer` header with `--opt=off` Created: 01/Jun/23 Updated: 18/Jan/24 Resolved: 07/Jun/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc3, 5.0.25, 6.0.14 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.0, v6.0, v5.0
|
||||||||||||
| Sprint: | Execution Team 2023-06-12 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Immer incorrectly assumes GCC does not support exceptions, because it's checking a clang-specific feature macro. Furthermore, with optimization turned off, its IMMER_RETHROW empty definition yields a function missing a return statement, a fatal build warning for us. Scons script and output attached. Essentially this scons invocation:
Yields a series of fatal warnings:
|
| Comments |
| Comment by Githook User [ 18/Jan/24 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: (cherry picked from commit 016bb8a5ecc4b91e0a6fdcc58d0ff66c238fa970) GitOrigin-RevId: b1eaa84c50588356f31c6da736f8dee2f2d5e26a |
| Comment by Githook User [ 17/Jan/24 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: (cherry picked from commit 016bb8a5ecc4b91e0a6fdcc58d0ff66c238fa970) GitOrigin-RevId: 8651ee570081d7fa33a44a53207494a4d390fcdf |
| Comment by Billy Donahue [ 26/Jun/23 ] |
|
Our upstream issue report received a response. Created SERVER-78430 as dependent on this ticket, to track the creation of a long-term and upstreamable fix for this problem. |
| Comment by Githook User [ 07/Jun/23 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: (cherry picked from commit 016bb8a5ecc4b91e0a6fdcc58d0ff66c238fa970) |
| Comment by Githook User [ 06/Jun/23 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: |
| Comment by Billy Donahue [ 01/Jun/23 ] |
|
Opened bug with upstream just about the IMMER_RETHROW. |
| Comment by Billy Donahue [ 01/Jun/23 ] |
|
henrik.edin@mongodb.com feel free to reassign. I only named you because you'll know who owns this |
| Comment by Billy Donahue [ 01/Jun/23 ] |
|
Idea: maybe IMMER_RETHROW should be __builtin_unreachable() or similar if exceptions are disabled. https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable or into a call to any function marked [[noreturn]], such as std::terminate, which is a portable solution. |
| Comment by Billy Donahue [ 01/Jun/23 ] |
|
https://mongodb.slack.com/archives/CQDQ9R413/p1685640114769829
As a result, it appears that the immer library will behave drastically differently on clang vs gcc. On clang builds it will be exception-based but on gcc builds the same code paths will kill the server. |