code that checks if the address sanitizer preprocessor variable is defined should check both the gcc and clang variables

XMLWordPrintableJSON

    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            DO NOT USE - Backlog - Dev Tools
            Reporter:
            Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: