]> Cypherpunks repositories - gostls13.git/commit
runtime/race: don't crash on invalid PCs
authorDmitry Vyukov <dvyukov@google.com>
Sat, 24 Sep 2016 15:07:35 +0000 (17:07 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Sun, 25 Sep 2016 12:22:04 +0000 (12:22 +0000)
commit38765eba739461e5c5dc463860c62daee2eef4ee
tree78cb9825e6e5da296d8dfa2240aea1df36a20228
parent9f1c78781b320b6d7cf83378b857c1168cb7fd0f
runtime/race: don't crash on invalid PCs

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: Ian Lance Taylor <iant@golang.org>
src/runtime/race.go
src/runtime/race/output_test.go