Fix pointer checkptr when using -race flag #11
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a sample PR, since actually the uint32 can be improved.
Basically it does 2 things:
1- Bump version to 1.18 (at least should be 1.17 to use unsafe.Slice)
2- Remove panic from runtime ptr check when using -race flag.
Sample error:
fatal error: checkptr: pointer arithmetic computed bad pointer value
goroutine 22 [running]:
runtime.throw({0x903beb?, 0x4083ed?})
C:/Program Files/Go/src/runtime/panic.go:992 +0x76 fp=0xc00008bc60 sp=0xc00008bc30 pc=0x438336
runtime.checkptrArithmetic(0xc000016070?, {0x0?, 0xc00008bcc8?, 0x40efc7?})
C:/Program Files/Go/src/runtime/checkptr.go:53 +0xbb fp=0xc00008bc90 sp=0xc00008bc60 pc=0x4085bb
github.com/bi-zone/etw.(*Session).processEvents.func1(0xc00022a360, 0x1)
C:/Users/lcostant/go/pkg/mod/github.com/bi-zone/etw@v0.0.0-20210519083747-fe9042eb0ea8/session.go:324 +0x7e fp=0xc00008bcd8 sp=0xc00008bc90 pc=0x75295e
github.com/bi-zone/etw.(*Session).processEvents(0xc00022a360?, 0x0?)
C:/Users/lcostant/go/pkg/mod/github.com/bi-zone/etw@v0.0.0-20210519083747-fe9042eb0ea8/session.go:324 +0x11a fp=0xc00008bd98 sp=0xc00008bcd8 pc=0x75273a
github.com/bi-zone/etw.(*Session).Process(0xc00022a360, 0xc000040000)
C:/Users/lcostant/go/pkg/mod/github.com/bi-zone/etw@v0.0.0-20210519083747-fe9042eb0ea8/session.go:126 +0x1c7 fp=0xc00008be80 sp=0xc00008bd98 pc=0x751ae7
github.com/lcostantino/Panoptes/panoptes.(*Client).Start.func1({0xc0000c0360, 0x26}, {0xc0000a9535, 0xb}, {0xbb60b0, 0x0, 0x0})
C:/Users/lcostant/repos/panoptes/panoptes/client.go:81 +0x265 fp=0xc00008bf58 sp=0xc00008be80 pc=0x754ea5
github.com/lcostantino/Panoptes/panoptes.(*Client).Start.func4()
C:/Users/lcostant/repos/panoptes/panoptes/client.go:110 +0xaf fp=0xc00008bfe0 sp=0xc00008bf58 pc=0x754bef
runtime.goexit()
C:/Program Files/Go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc00008bfe8 sp=0xc00008bfe0 pc=0x467001
created by github.com/lcostantino/Panoptes/panoptes.(*Client).Start
C:/Users/lcostant/repos/panoptes/panoptes/client.go:79 +0x16e
goroutine 1 [chan receive]:
main.main()
C:/Users/lcostant/repos/panoptes/app/panoptes.go:291 +0x141a