Closed jonnsl closed 8 years ago
server.go:288 is actually a close brace, and the source of the exception is within kill
. Perhaps you do not have an up to date go-syslog
. Could you try updating to master?
without using gopkg.in, here is the new error message:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x4749e9]
goroutine 6 [running]:
github.com/mcuadros/go-syslog.(*Server).goReceiveDatagrams.func1(0xc820092090, 0x7f0695cf94c0, 0xc82002e030)
/home/jonnathan/go/src/github.com/mcuadros/go-syslog/server.go:326 +0x179
created by github.com/mcuadros/go-syslog.(*Server).goReceiveDatagrams
/home/jonnathan/go/src/github.com/mcuadros/go-syslog/server.go:339 +0x11e
goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc8200920cc)
/usr/lib/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc8200920c0)
/usr/lib/go/src/sync/waitgroup.go:126 +0xb4
github.com/mcuadros/go-syslog.(*Server).Wait(0xc820092090)
/home/jonnathan/go/src/github.com/mcuadros/go-syslog/server.go:292 +0x2d
main.main()
/home/jonnathan/go/src/github.com/jonnsl/ssd/ssd.go:35 +0x33e
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1
goroutine 5 [chan receive]:
github.com/mcuadros/go-syslog.(*Server).goParseDatagrams.func1(0xc820092090)
/home/jonnathan/go/src/github.com/mcuadros/go-syslog/server.go:350 +0xc5
created by github.com/mcuadros/go-syslog.(*Server).goParseDatagrams
/home/jonnathan/go/src/github.com/mcuadros/go-syslog/server.go:363 +0x92
goroutine 7 [chan receive]:
main.main.func1(0xc820014180)
/home/jonnathan/go/src/github.com/jonnsl/ssd/ssd.go:30 +0x5d
created by main.main
/home/jonnathan/go/src/github.com/jonnsl/ssd/ssd.go:33 +0x330
Thanks for the report.
I think I have fixed this (my fault) on this branch: https://github.com/abligh/go-syslog/tree/fix-null-datagram-address
You can try the fix locally with this patch: https://github.com/abligh/go-syslog/commit/429245c3f9acbb7769551bea54800f5ae0342be9
If you confirm it fixes this issue then I will send a pull request.
It works perfectly, thanks!
Thanks. Pull Request #27 generated.
I'm trying to receive logs from nginx using unix sockets, but when nginx sends the first message, nothing happens, on the second message, the program crashes.
Here is my code:
ListenUDP works though