zhangpeihao / gortmp

Implement RTMP protocol by golang
MIT License
523 stars 162 forks source link

Segfault #10

Closed ghost closed 9 years ago

ghost commented 9 years ago

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff701a700 (LWP 627)] 0x00000000005c5429 in github.com/zhangpeihao/log.(*Logger).ModulePrintf (logger=0x0, module=0x0, level=4, format=..., v=...) at /home/president/go/src/github.com/zhangpeihao/log/log.go:335 335

Output from gdb, trying to connect.

runtime error: invalid memory address or nil pointer dereference

Output from execution.

zhangpeihao commented 9 years ago

You should set the logger before use this lib:

l := log.NewLogger(".", "server", nil, 60, 3600*24, true)
l.SetMainLevel(log.LOG_LEVEL_DEBUG)
rtmp.InitLogger(l)

I added the default logger to fix this bug. You can update the codes from github.

ghost commented 9 years ago

Alright, thanks. I'm fairly new to Go so i'm still learning.