• Dmitry Vyukov's avatar
    runtime/race: don't crash on invalid PCs · 38765eba
    Dmitry Vyukov authored
    Currently raceSymbolizeCode uses funcline, which is internal runtime
    function which crashes on incorrect PCs. Use FileLine instead,
    it is public and does not crash on invalid data.
    
    Note: FileLine returns "?" file on failure. That string is not NUL-terminated,
    so we need to additionally check what FileLine returns.
    
    Fixes #17190
    
    Change-Id: Ic6fbd4f0e68ddd52e9b2dd25e625b50adcb69a98
    Reviewed-on: https://go-review.googlesource.com/29714
    Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    38765eba
output_test.go 5.02 KB