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 #10

Open
l-margiela opened this issue Oct 7, 2014 · 4 comments

Comments

@l-margiela
Copy link

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

@dborzov
Copy link
Owner

dborzov commented Oct 7, 2014

heh, thanks for reporting that, will look into this

@rydn
Copy link

rydn commented May 22, 2015

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

@langston-barrett
Copy link
Contributor

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.

@voxadam
Copy link

voxadam commented Sep 4, 2015

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%

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

No branches or pull requests

5 participants