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

Crash on first time. #248

Open
stephanemartin opened this issue Jun 30, 2020 · 5 comments
Open

Crash on first time. #248

stephanemartin opened this issue Jun 30, 2020 · 5 comments
Labels

Comments

@stephanemartin
Copy link

stephanemartin commented Jun 30, 2020

Version: master branch
Installation method: go get -u github.com/erroneousboat/slack-term
~/go/src/github.com/erroneousboat/slack-term$ go install .
~/go/bin$ ./slack-term -token xxxxxxxxxxxxx

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x84e5b6]

goroutine 1 [running]:
github.com/erroneousboat/slack-term/service.NewSlackService(0xc0000d2dc0, 0x27, 0xc0000d2dc0, 0x0)
/home/smartin/go/src/github.com/erroneousboat/slack-term/service/slack.go:71 +0x2b6
github.com/erroneousboat/slack-term/context.CreateAppContext(0xc00002a210, 0x27, 0x7fff9b8cf768, 0x4c, 0x0, 0x98e37d, 0x6, 0xc0000fc5a0, 0x116, 0xc0000a0160, ...)
/home/smartin/go/src/github.com/erroneousboat/slack-term/context/context.go:81 +0xd7
main.main()
/home/smartin/go/src/github.com/erroneousboat/slack-term/main.go:99 +0x1c2

@al-the-x
Copy link

al-the-x commented Sep 1, 2020

Affected by same. Will attempt to install via binary next.

@al-the-x
Copy link

al-the-x commented Sep 1, 2020

Same result with binary v0.5.0: https://github.com/erroneousboat/slack-term/releases/tag/v0.5.0

$> slack-term-darwin-amd64 -config ~/.config/slack-term.config
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1440ba6]

goroutine 1 [running]:
github.com/erroneousboat/slack-term/service.NewSlackService(0xc0000acdc0, 0x29, 0xc0000acdc0, 0x0)
        /home/jp/Projects/slack-term/service/slack.go:71 +0x2b6
github.com/erroneousboat/slack-term/context.CreateAppContext(0x7ffeefbfeb62, 0x29, 0x0, 0x0, 0x0, 0x157420f, 0x6, 0xc00002c900, 0x116, 0xc00001e1c0, ...)
        /home/jp/Projects/slack-term/context/context.go:81 +0xd7
main.main()
        /home/jp/Projects/slack-term/main.go:99 +0x1c2

@al-the-x
Copy link

al-the-x commented Sep 1, 2020

Same result on v0.4.1 but different stack trace:

$> slack-term-darwin-amd64 -config ~/.config/slack-term.config
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x13a26d1]

goroutine 1 [running]:
github.com/erroneousboat/slack-term/service.NewSlackService(0xc420250000, 0x29, 0xc420250000, 0x0)
        /home/jp/go/src/github.com/erroneousboat/slack-term/service/slack.go:66 +0x2f1
github.com/erroneousboat/slack-term/context.CreateAppContext(0x7ffeefbfeb62, 0x29, 0x0, 0x0, 0x0, 0x14b1fc7, 0x6, 0xc42024e120, 0x116, 0x0, ...)
        /home/jp/go/src/github.com/erroneousboat/slack-term/context/context.go:77 +0xd3
main.main()
        /home/jp/go/src/github.com/erroneousboat/slack-term/main.go:102 +0x1b4

FWIW, my slack-term.config only contains the key slack_token with the token I obtained through the GitHub Pages method from the wiki.

@mbafford
Copy link

mbafford commented Feb 2, 2021

Confirmed the same result as the above reports - both pulling the binaries and building from scratch off of the current head #c19c20a

The nil pointer dereference is happening on slack.go line 66:

 // Get name of current user, and set presence to active
currentUser, err := svc.Client.GetUserInfo(svc.CurrentUserID)
if err != nil {
    svc.CurrentUsername = "slack-term"
}

svc.CurrentUsername = currentUser.Name // <--- crashes HERE due to null currentUser

Changing to this gets around the crash:

 // Get name of current user, and set presence to active
currentUser, err := svc.Client.GetUserInfo(svc.CurrentUserID)
if err != nil {
    svc.CurrentUsername = "slack-term"
} else {
    svc.CurrentUsername = currentUser.Name
}

Then the program exits with the error message:

2021/02/02 13:29:56 missing_scope

It looks like something isn't set up correctly with the token / access, causing the user info to not be available and the missing_scope error.

@weust1979
Copy link

Same issue here on FreeBSD (13.0-several), running version 0.5.0_1 from ports.

*panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x7070d0]
goroutine 125 [running]:14]
github.com/0xAX/notificator.Notificator.Push(0x0, 0x0, 0x0, 0x0, 0x83f97e, 0xa, 0xc000304d50, 0x21, 0x0, 0x0, ...)
  ● eli/wrkdirs/usr/ports/net-im/slack-term/work/github.com/erroneousboat/[email protected]/vendor/github.com/0xAX/notificator/notification.go:42 +0x70
github.com/erroneousboat/slack-term/handlers.createNotifyMessage.func1(0xc0004be000, 0xc000128780)
  ○ gre/wrkdirs/usr/ports/net-im/slack-term/work/github.com/erroneousboat/[email protected]/handlers/event.go:806 +0x245
created by github.com/erroneousboat/slack-term/handlers.createNotifyMessage
  ○ jac/wrkdirs/usr/ports/net-im/slack-term/work/github.com/erroneousboat/[email protected]/handlers/event.go:784 +0x49

When started I can scroll through the channels just fine, typing not sure atm, but after a minute or so it will crash.

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

No branches or pull requests

5 participants