Fix unsafe pointer conversion#325
Merged
cpuguy83 merged 1 commit intofsnotify:masterfrom Apr 17, 2020
Merged
Conversation
Fix the following unsafe pointer conversion found using the Go 1.14 -d=checkptr gcflags (`go1.14rc1 test -gcflags=all=-d=checkptr -v ./...`) ``` fatal error: checkptr: unsafe pointer conversion goroutine 68 [running]: runtime.throw(0x5833e9, 0x23) runtime/panic.go:1112 +0x72 fp=0xc00030fba8 sp=0xc00030fb78 pc=0x432a32 runtime.checkptrAlignment(0xc00031f018, 0x544800, 0x1) runtime/checkptr.go:18 +0xb7 fp=0xc00030fbd8 sp=0xc00030fba8 pc=0x4063a7 github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0002900f0) github.com/fsnotify/fsnotify/inotify.go:275 +0x457 fp=0xc00031ffd8 sp=0xc00030fbd8 pc=0x519037 runtime.goexit() runtime/asm_amd64.s:1375 +0x1 fp=0xc00031ffe0 sp=0xc00031ffd8 pc=0x463eb1 created by github.com/fsnotify/fsnotify.NewWatcher github.com/fsnotify/fsnotify/inotify.go:59 +0x1a5 ``` Fixes fsnotify#330
6bcbe79 to
eefd702
Compare
Contributor
Author
tirmatovcl
pushed a commit
to cloudlinux/fsnotify
that referenced
this pull request
May 6, 2020
Fix the following unsafe pointer conversion found using the Go 1.14 -d=checkptr gcflags (`go1.14rc1 test -gcflags=all=-d=checkptr -v ./...`) ``` fatal error: checkptr: unsafe pointer conversion goroutine 68 [running]: runtime.throw(0x5833e9, 0x23) runtime/panic.go:1112 +0x72 fp=0xc00030fba8 sp=0xc00030fb78 pc=0x432a32 runtime.checkptrAlignment(0xc00031f018, 0x544800, 0x1) runtime/checkptr.go:18 +0xb7 fp=0xc00030fbd8 sp=0xc00030fba8 pc=0x4063a7 github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0002900f0) github.com/fsnotify/fsnotify/inotify.go:275 +0x457 fp=0xc00031ffd8 sp=0xc00030fbd8 pc=0x519037 runtime.goexit() runtime/asm_amd64.s:1375 +0x1 fp=0xc00031ffe0 sp=0xc00031ffd8 pc=0x463eb1 created by github.com/fsnotify/fsnotify.NewWatcher github.com/fsnotify/fsnotify/inotify.go:59 +0x1a5 ``` Fixes fsnotify#330
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this pull request do?
Fix the following unsafe pointer conversion found using the Go 1.14
-d=checkptr gcflags(go1.14rc1 test -gcflags=all=-d=checkptr -v ./...)Fixes #330
Where should the reviewer start?
See below.
How should this be manually tested?
Run tests with
go1.14rc1 test -gcflags=all=-d=checkptr -v ./...to observe the unsafe pointer conversion error. After applying this PR it should be gone and all tests pass.