[SERVER-23380] code that checks if the address sanitizer preprocessor variable is defined should check both the gcc and clang variables Created: 28/Mar/16  Updated: 06/Dec/22  Resolved: 13/Aug/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 3.3.3
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: DO NOT USE - Backlog - Dev Tools
Resolution: Won't Fix Votes: 0
Labels: platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Developer Tools
Participants:
Linked BF Score: 0

 Description   

For example, the wired tiger shutdown code decides whether or not to leak memory by checking preprocessor variables, but only checks the clang version (__has_feature(address_sanitizer)):

https://github.com/mongodb/mongo/blob/r3.3.3/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp#L319-L323

This can lead to confusion when seeing memory leaks when ASan is used with the gcc compiler.

As suggested by max.hirschhorn, both the gcc and clang variables should be checked, as is done in shell_utils.cpp:

https://github.com/mongodb/mongo/blob/r3.3.3/src/mongo/shell/shell_utils.cpp#L154-L169



 Comments   
Comment by Gregory McKeon (Inactive) [ 13/Aug/18 ]

Not causing us pain right now, so closing won't fix.

Generated at Thu Feb 08 04:03:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.