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

Random Server Panic Events (nil pointer dereference) when processing RTMP Streams #112

Open
Abhin33t opened this issue May 24, 2020 · 0 comments

Comments

@Abhin33t
Copy link

Abhin33t commented May 24, 2020

Hello

Often, the following nil pointer de-reference error has been occurring with the RTMP servers quite randomly -

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6ed13e]
goroutine 149 [running]:
github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.createURL(0xc0003e2900, 0x1f, 0xc0003cc034, 0x4, 0xc0003cc1e0, 0x7, 0x0)
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:345 +0x22e
github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.(*Conn).readConnect(0xc000580900, 0x0, 0x0)
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:482 +0xf25
github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.(*Conn).prepare(0xc000580900, 0x2, 0x0, 0x0, 0x0)
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:818 +0x173
github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.(*Server).handleConn(0xc000246b10, 0xc000580900, 0x0, 0x0)
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:67 +0x75
github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.(*Server).ListenAndServe.func1(0xc000246b10, 0xc000580900)
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:118 +0x39
created by github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp.(*Server).ListenAndServe
        /home/user/go/src/github.com/livego2/vendor/github.com/nareix/joy4/format/rtmp/rtmp.go:117 +0x1a2

Following the stack-trace reveals that the tcurl Host doesn't set after url.Parse call (although the exact reason isn't known necessitating a deep-dive):

if tcurl != "" {
		tu, _ := url.Parse(tcurl)
		if tu != nil {
			u.Host = tu.Host
			u.Scheme = tu.Scheme
		}
	} 

I suspect it might be related to disconnection issues although that's a guess.
Has anyone else encountered this issue?
Are there any suggested remedial actions to undertake to find the root cause?
The issue replication has proved to be elusive so far.

Thanks

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

No branches or pull requests

1 participant