• Sasha Goldshtein's avatar
    cc: Work around verifier error when reading USDT probe arguments · 2070a2ae
    Sasha Goldshtein authored
    The code generated by the USDT helpers for reading probe arguments
    occasionally caused a verifier error due to a construct similar to
    the following:
    
    ```
    switch (ctx->ip) {
    case 0xaaaa: *dest = ctx->cx; break;
    case 0xbbbb: *dest = ctx->dx; break;
    }
    ```
    
    This would generate an instruction sequence that attempts to access
    ctx through an offset that is not statically known, which confuses
    the verifier. This was reported in #751, #829, and #1133, and likely
    seen by others as well.
    
    The workaround, suggested by @yonghong-song, is to force memory
    writes by using the volatile modifier, which precludes this specific
    optimization.
    
    Resolves #751, #829, #1133.
    2070a2ae
usdt.cc 11.5 KB