Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: invalid memory address or nil pointer dereference #5

Closed
mohuishou opened this issue May 7, 2018 · 10 comments
Closed

Comments

@mohuishou
Copy link

run gopkgs in windoes 10
go version: go version go1.10.1 windows/amd64
It is not clear what caused the error.

gopkgs
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x57ea52]

goroutine 37 [running]:
github.com/MichaelTJones/walk.(*WalkState).visitFile(0xc0421101e0, 0xc0434d6780, 0x3b, 0x0, 0x0)
        E:/SoftFile/GOPATH/src/github.com/MichaelTJones/walk/walk.go:108 +0x2f2
github.com/MichaelTJones/walk.(*WalkState).visitChannel(0xc0421101e0)
        E:/SoftFile/GOPATH/src/github.com/MichaelTJones/walk/walk.go:71 +0xa2
created by github.com/MichaelTJones/walk.Walk
        E:/SoftFile/GOPATH/src/github.com/MichaelTJones/walk/walk.go:157 +0x1b9
@uudashr
Copy link
Owner

uudashr commented May 7, 2018

@mohuishou does the panic consistent on every gopkgs?

@mohuishou
Copy link
Author

yes, every gopkgs panic

@mohuishou
Copy link
Author

I found the cause of the error.There is a non-existent file in my gopath directory.
In this case,in MichaelTJones/walk/walk.go, file.info is nil
So that leads to this error.
The problem was solved after the file was deleted.

if err != nil && (!file.info.IsDir() || err != SkipDir) {
    ws.setTerminated(err)
    return
}

@uudashr
Copy link
Owner

uudashr commented May 8, 2018

What do you mean with non-existent file in gopath? What file?
How to reproduce the error? and how to fix it?

@wsw0108
Copy link

wsw0108 commented May 8, 2018

'NUL'

@mohuishou
Copy link
Author

Sorry for the poor English.Have a file when deleting Windows will appear "file not found" error.

@uudashr
Copy link
Owner

uudashr commented May 8, 2018

So I'd better to close this. If these anything else related to this, then I'll reopen the issue.

@uudashr uudashr closed this as completed May 8, 2018
@wsw0108
Copy link

wsw0108 commented May 8, 2018

@mohuishou Please check if there are files with name NUL, CON, etc, which has special meaning under Windows.

@uudashr uudashr reopened this May 16, 2018
@uudashr
Copy link
Owner

uudashr commented May 16, 2018

Need help here.
@mohuishou can you update the and run the gopkgs command

$ go get -u github.com/uudashr/gopkgs/cmd/gopkgs
$ gopkgs -format '{{.Name}};{{.ImportPath}}'

I want to know if the error still exists

@no-response
Copy link

no-response bot commented Jun 1, 2018

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants