lsp
lsp copied to clipboard
panic: runtime error: invalid memory address or nil pointer dereference
Hello, I've installed lsp using go get github.com/dborzov/lsp
and when I tried to run lsp in any directory I've got error like this:
➜ empty ls -a
. ..
➜ empty lsp
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x403362]
goroutine 1 [running]:
runtime.panic(0x4fd180, 0x6502e8)
/usr/lib/golang/src/pkg/runtime/panic.c:266 +0xb6
main.presentPath(0xc21004c640, 0x11, 0xc21004c820, 0x1b)
/home/xaxes/.go/src/github.com/dborzov/lsp/paths.go:11 +0x32
main.renderSummary()
/home/xaxes/.go/src/github.com/dborzov/lsp/render.go:20 +0x7b
main.render()
/home/xaxes/.go/src/github.com/dborzov/lsp/render.go:15 +0x24
main.main()
/home/xaxes/.go/src/github.com/dborzov/lsp/main.go:23 +0x245
goroutine 3 [sleep]:
time.Sleep(0xbebc200)
/usr/lib/golang/src/pkg/runtime/time.goc:31 +0x31
main.func·002()
/home/xaxes/.go/src/github.com/dborzov/lsp/utils.go:10 +0x26
created by main.setTimeoutTimer
/home/xaxes/.go/src/github.com/dborzov/lsp/utils.go:12 +0x21
I'm using Fedora 20 and FS is XFS if it does matter
heh, thanks for reporting that, will look into this
Yup... Me too, Fedora 21
FS is btrfs if it matters.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x404b2e]
goroutine 1 [running]:
main.presentPath(0xc20803a8d0, 0x25, 0x0, 0x0)
/home/ryan/.gocode/src/github.com/lsp/paths.go:11 +0x16e
main.renderSummary()
/home/ryan/.gocode/src/github.com/lsp/fmt.go:58 +0x8f
main.render()
/home/ryan/.gocode/src/github.com/lsp/fmt.go:53 +0x25
main.main()
/home/ryan/.gocode/src/github.com/lsp/main.go:24 +0x372
goroutine 26 [sleep]:
main.func·002()
/home/ryan/.gocode/src/github.com/lsp/utils.go:10 +0x27
created by main.setTimeoutTimer
/home/ryan/.gocode/src/github.com/lsp/utils.go:12 +0x25
Looks like Golang can't find the user's home dir. Perhaps logging a warning or having a default (maybe /home/[username] or /Users/[username] for OSX) would work better?
I can create a pull once we get an outline.
I seem to be hitting this same bug.
[adam@Drogon]~/devel/go/src% lsp
--------------------------------------------------------------------------------------------------------------------------------------
bazil.org dir(96 files)
bitbucket.org dir(33 files)
code.google.com dir(718 files)
github.com dir(3699 files)
golang.org dir(622 files)
gopkg.in dir(85 files)
launchpad.net dir(27 files)
--------------------------------------------------------------------------------------------------------------------------------------
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x40504e]
goroutine 1 [running]:
main.presentPath(0xc20801e400, 0x17, 0x0, 0x0)
/home/adam/devel/go/src/github.com/dborzov/lsp/paths.go:11 +0x16e
main.renderSummary()
/home/adam/devel/go/src/github.com/dborzov/lsp/fmt.go:61 +0x8f
main.render()
/home/adam/devel/go/src/github.com/dborzov/lsp/fmt.go:56 +0x25
main.main()
/home/adam/devel/go/src/github.com/dborzov/lsp/main.go:28 +0x508
goroutine 12 [sleep]:
main.func·002()
/home/adam/devel/go/src/github.com/dborzov/lsp/utils.go:10 +0x27
created by main.setTimeoutTimer
/home/adam/devel/go/src/github.com/dborzov/lsp/utils.go:12 +0x25
[adam@Drogon]~/devel/go/src%