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

Closed
easyhhvm opened this issue Aug 10, 2018 · 4 comments
Closed
Labels
type/bug Feature does not function as expected type/crash The issue description contains a golang panic and stack trace
Milestone

Comments

@easyhhvm
Copy link

Overview of the Issue

(consul_1.2.2) Version: 'v1.2.2'
==> Starting Consul agent...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x106b896]

goroutine 1 [running]:
github.com/hashicorp/consul/agent.(*Agent).consulConfig(0xc42012e000, 0xc42009a2d0, 0xdf8475800, 0xc420094240)
/go/src/github.com/hashicorp/consul/agent/agent.go:824 +0x3d6
github.com/hashicorp/consul/agent.(*Agent).Start(0xc42012e000, 0xc42012e000, 0x0)
/go/src/github.com/hashicorp/consul/agent/agent.go:311 +0x2a7
github.com/hashicorp/consul/command/agent.(*cmd).run(0xc420259800, 0xc42002e0b0, 0x1, 0x1, 0x0)
/go/src/github.com/hashicorp/consul/command/agent/agent.go:219 +0x454
github.com/hashicorp/consul/command/agent.(*cmd).Run(0xc420259800, 0xc42002e0b0, 0x1, 0x1, 0xc42038ef00)
/go/src/github.com/hashicorp/consul/command/agent/agent.go:74 +0x50
github.com/hashicorp/consul/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc4201ff320, 0xc4201ff320, 0x40, 0xc42038f200)
/go/src/github.com/hashicorp/consul/vendor/github.com/mitchellh/cli/cli.go:242 +0x1eb
main.realMain(0xc420094058)
/go/src/github.com/hashicorp/consul/main.go:53 +0x3ee
main.main()
/go/src/github.com/hashicorp/consul/main.go:20 +0x22

Overview of the Issue

(consul_1.0.0) Version: 'v1.0.0'
==> Starting Consul agent...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe53d4e]

goroutine 1 [running]:
github.com/hashicorp/consul/agent.(*Agent).consulConfig(0xc42021c4e0, 0xc420158320, 0xc42015e360, 0xc420178d80)
/gopath/src/github.com/hashicorp/consul/agent/agent.go:646 +0x32e
github.com/hashicorp/consul/agent.(*Agent).Start(0xc42021c4e0, 0xc42021c4e0, 0x0)
/gopath/src/github.com/hashicorp/consul/agent/agent.go:248 +0x169
github.com/hashicorp/consul/command.(*AgentCommand).run(0xc4202bc1e0, 0xc42000e0b0, 0x1, 0x1, 0x0)
/gopath/src/github.com/hashicorp/consul/command/agent.go:320 +0x4e0
github.com/hashicorp/consul/command.(*AgentCommand).Run(0xc4202bc1e0, 0xc42000e0b0, 0x1, 0x1, 0xc4201d3620)
/gopath/src/github.com/hashicorp/consul/command/agent.go:267 +0x50
github.com/hashicorp/consul/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc420229320, 0xc420229320, 0x40, 0xc42029f6a0)
/gopath/src/github.com/hashicorp/consul/vendor/github.com/mitchellh/cli/cli.go:242 +0x1eb
main.realMain(0xef5bd7)
/gopath/src/github.com/hashicorp/consul/main.go:52 +0x3fb
main.main()
/gopath/src/github.com/hashicorp/consul/main.go:19 +0x22

@easyhhvm
Copy link
Author

easyhhvm commented Aug 10, 2018

uname -a

Linux A 2.6.32-696.el6.x86_64 #1 SMP 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

consul_1.0.0_linux_amd64.zip

consul_1.2.2_linux_amd64.zip

@pearkes pearkes added type/bug Feature does not function as expected type/crash The issue description contains a golang panic and stack trace labels Aug 10, 2018
@pearkes
Copy link
Contributor

pearkes commented Aug 10, 2018

Thanks for reporting this. Can you share your configuration?

@easyhhvm
Copy link
Author

configuration

{
"datacenter": "xxx",
"data_dir": "/data/consul/",
"log_level": "INFO",
"node_name": "X1",
"bind_addr": "10.1.2.3",
"client_addr": "127.0.0.1",
"ports": {
"serf_wan": -1,
"dns": -1
},
"reconnect_timeout": "10h",
"reconnect_timeout_wan": "10h",
"enable_script_checks": true,
"ui": true,
}

Thank you
Using "serf_wan": -1 and "reconnect_timeout_wan" at the same time will produce errors.

@pearkes
Copy link
Contributor

pearkes commented Aug 13, 2018

Using "serf_wan": -1 and "reconnect_timeout_wan" at the same time will produce errors.

That is really helpful, thank you. I think this may have been a side-effect of allowing serf_wan to be disabled, see #3984.

@pearkes pearkes added this to the 1.2.3 milestone Aug 13, 2018
mkeeler added a commit that referenced this issue Aug 17, 2018
…was set (#4531)

Fixes #4515 

This just slightly refactors the logic to only attempt to set the serf wan reconnect timeout when the rest of the serf wan settings are configured - thus avoiding a segfault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Feature does not function as expected type/crash The issue description contains a golang panic and stack trace
Projects
None yet
Development

No branches or pull requests

2 participants