jpillora / overseer

Monitorable, gracefully restarting, self-upgrading binaries in Go (golang)
MIT License
2.32k stars 208 forks source link

Can I not set Address And Addresses? My app isn't used to listen any port. #76

Open SteveCruise opened 2 years ago

SteveCruise commented 2 years ago

When I don't set both Address and Addresses, it has a mistake:

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

goroutine 1 [running]:
net/http.(*onceCloseListener).close(0xc000092cf0)
    /usr/local/go/src/net/http/server.go:3479 +0x20
sync.(*Once).doSlow(0xc000100180?, 0xc0000c38d0?)
    /usr/local/go/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
    /usr/local/go/src/sync/once.go:59
net/http.(*onceCloseListener).Close(0xc000092cf0?)
    /usr/local/go/src/net/http/server.go:3475 +0x4a
panic({0x640680, 0x84d140})
    /usr/local/go/src/runtime/panic.go:838 +0x207
net/http.(*onceCloseListener).Accept(0x6ee250?)
    <autogenerated>:1 +0x24
net/http.(*Server).Serve(0xc0001000e0, {0x0, 0x0})
    /usr/local/go/src/net/http/server.go:3039 +0x385
net/http.Serve(...)
    /usr/local/go/src/net/http/server.go:2543
main.prog({0x1, {0xc000020090, 0x28}, {0xc0a568efa87b5794, 0x4aa32, 0x85a2e0}, {0x0, 0x0}, {0x889d30, 0x0, ...}, ...})
    /home/lee/Projects/overseer/example/main.go:26 +0x1ad
github.com/jpillora/overseer.(*slave).run(0xc000100000)
    /home/lee/Projects/overseer/proc_slave.go:77 +0x315
github.com/jpillora/overseer.runErr(0xc0000fe000)
    /home/lee/Projects/overseer/overseer.go:162 +0x12b
github.com/jpillora/overseer.Run({0x0, 0x6a77a0, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0, ...})
    /home/lee/Projects/overseer/overseer.go:99 +0x99
main.main()
jpillora commented 2 years ago

You can set one of them, or neither, not both

On Fri, 24 Jun 2022 at 1:25 pm SteveCruise @.***> wrote:

When I don't set both Address and Addresses, it has a mistake:

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

goroutine 1 [running]: net/http.(onceCloseListener).close(0xc000092cf0) /usr/local/go/src/net/http/server.go:3479 +0x20 sync.(Once).doSlow(0xc000100180?, 0xc0000c38d0?) /usr/local/go/src/sync/once.go:68 +0xc2 sync.(Once).Do(...) /usr/local/go/src/sync/once.go:59 net/http.(onceCloseListener).Close(0xc000092cf0?) /usr/local/go/src/net/http/server.go:3475 +0x4a panic({0x640680, 0x84d140}) /usr/local/go/src/runtime/panic.go:838 +0x207 net/http.(*onceCloseListener).Accept(0x6ee250?)

:1 +0x24 net/http.(*Server).Serve(0xc0001000e0, {0x0, 0x0}) /usr/local/go/src/net/http/server.go:3039 +0x385 net/http.Serve(...) /usr/local/go/src/net/http/server.go:2543 main.prog({0x1, {0xc000020090, 0x28}, {0xc0a568efa87b5794, 0x4aa32, 0x85a2e0}, {0x0, 0x0}, {0x889d30, 0x0, ...}, ...}) /home/lee/Projects/overseer/example/main.go:26 +0x1adgithub.com/jpillora/overseer.(*slave).run(0xc000100000) /home/lee/Projects/overseer/proc_slave.go:77 +0x315github.com/jpillora/overseer.runErr(0xc0000fe000) /home/lee/Projects/overseer/overseer.go:162 +0x12bgithub.com/jpillora/overseer.Run({0x0 , 0x6a77a0, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0, ...}) /home/lee/Projects/overseer/overseer.go:99 +0x99 main.main() — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>