• Mark Rutland's avatar
    kcsan: Report observed value changes · 7bbe6dc0
    Mark Rutland authored
    When a thread detects that a memory location was modified without its
    watchpoint being hit, the report notes that a change was detected, but
    does not provide concrete values for the change. Knowing the concrete
    values can be very helpful in tracking down any racy writers (e.g. as
    specific values may only be written in some portions of code, or under
    certain conditions).
    
    When we detect a modification, let's report the concrete old/new values,
    along with the access's mask of relevant bits (and which relevant bits
    were modified). This can make it easier to identify potential racy
    writers. As the snapshots are at most 8 bytes, we can only report values
    for acceses up to this size, but this appears to cater for the common
    case.
    
    When we detect a race via a watchpoint, we may or may not have concrete
    values for the modification. To be helpful, let's attempt to log them
    when we do as they can be ignored where irrelevant.
    
    The resulting reports appears as follows, with values...
    7bbe6dc0
core.c 36.6 KB