Skip to content

Commit

Permalink
cmd/stcrashreceiver: Aggregate slice out of bounds errors
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Oct 14, 2023
1 parent d4c2acf commit dc6a10d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/stcrashreceiver/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ var (
ldbFileRe = regexp.MustCompile(`(\[file=)([0-9]+)(\.ldb\])`)
ldbInternalKeyRe = regexp.MustCompile(`(internal key ")[^"]+(", len=)[0-9]+`)
ldbPathRe = regexp.MustCompile(`(open|write|read) .+[\\/].+[\\/]index[^\\/]+[\\/][^\\/]+: `)
sliceBoundsRe = regexp.MustCompile(`(slice bounds out of range) \[.+`)
)

func sanitizeMessageLDB(message string) string {
Expand All @@ -193,6 +194,7 @@ func sanitizeMessageLDB(message string) string {
message = ldbChecksumRe.ReplaceAllString(message, "${1}X${3}X")
message = ldbInternalKeyRe.ReplaceAllString(message, "${1}x${2}x")
message = ldbPathRe.ReplaceAllString(message, "$1 x: ")
message = sliceBoundsRe.ReplaceAllString(message, "$1")
return message
}

Expand Down

0 comments on commit dc6a10d

Please sign in to comment.