Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend life of variables in DiagComparison in ExprConstant #79522

Closed
wants to merge 2 commits into from

Commits on Jan 25, 2024

  1. Extend life of variables in DiagComparison in ExprConstant

    This commit makes two variables static extending their life span.
    This patch is designed to address the issue of buildbots failing when AddressSanitizer's (ASan) short string annotations are enabled.
    It's esentially same as:
    - llvm#79489
    however, it's less likely to solve the real problem as those strings change (aren't `const`).
    I suspect that there may be use after end of life bug (in StringRef), but it requires confirmation.
    In that case, one alternative solution, which unfortunately results in memory leaks, is to always allocate new strings instead of overwriting existing (static) ones. This approach would prevent potential data corruption, but I don't suggest it in this PR.
    
    This patch makes `Clang :: SemaCXX/builtins.cpp` test pass with short string annotations (ASan).
    With llvm#79489 it fixes known problems with buildbots, while running with short string annotations.
    However, the potential issue still requires more investigation therefore FIXME comment is added in that patch.
    
    Short string annotations PR (reverted):
    - llvm#79049
    
    Buildbots (failure) output:
    - https://lab.llvm.org/buildbot/#/builders/5/builds/40364/steps/9/logs/stdio
    
    While buildbots should not fail with proposed changes, we still should investigate why buildbots were failing with ASan short string annotations turned on.
    StringRef objects (made from those strings) can potentially change their contents unexpectedly or even (potentially) use of freed memory may happen.
    That interpretation is only my educated guess, I still didn't understand exactly why those buildbots are failing.
    Advenam Tacet committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    dc25384 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. additional comment

    Advenam Tacet committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    9dbd44e View commit details
    Browse the repository at this point in the history