go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

Panic: streams.(*Stream).RemoveConsumer

Open maxi1134 opened this issue 2 years ago • 6 comments

Hi, I am using Beta 11, and the software seems to crash after 20-22 hours of runnings and then needs to be restarted.

This is the error that is spammed when that happens;

2022/09/03 04:54:54 http: panic serving 192.168.0.15:47054: runtime error: invalid memory address or nil pointer dereference Which is odd since the machine still has free ram

maxi1134 avatar Sep 03 '22 15:09 maxi1134

You need to provide full error with lines numbers.

AlexxIT avatar Sep 03 '22 16:09 AlexxIT

Sorry for that;

https://pastebin.com/5kpmecyB

maxi1134 avatar Sep 03 '22 16:09 maxi1134

I think I already fix this bug. Will be in next release.

AlexxIT avatar Sep 03 '22 17:09 AlexxIT

I am pasting here because these may also be the same but I am not sure.....

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1f9f98]
goroutine 409 [running]:
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).RemoveConsumer(0x40001b1110, {0x7cc8a0?, 0x40001aafc0})
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:111 +0x138
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler.func1({0x60b620?, 0xb70850?})
	github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:89 +0x74
github.com/AlexxIT/go2rtc/pkg/streamer.(*Element).Fire(...)
	github.com/AlexxIT/go2rtc/pkg/streamer/streamer.go:27
github.com/AlexxIT/go2rtc/pkg/webrtc.(*Conn).Init.func3(0x6)
	github.com/AlexxIT/go2rtc/pkg/webrtc/conn.go:75 +0x6c
created by github.com/pion/webrtc/v3.(*PeerConnection).onConnectionStateChange
	github.com/pion/webrtc/[email protected]/peerconnection.go:492 +0x17c
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1f9f98]
goroutine 409 [running]:
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).RemoveConsumer(0x40001b1110, {0x7cc8a0?, 0x40001aafc0})
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:111 +0x138
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler.func1({0x60b620?, 0xb70850?})
	github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:89 +0x74
github.com/AlexxIT/go2rtc/pkg/streamer.(*Element).Fire(...)
	github.com/AlexxIT/go2rtc/pkg/streamer/streamer.go:27
github.com/AlexxIT/go2rtc/pkg/webrtc.(*Conn).Init.func3(0x6)
	github.com/AlexxIT/go2rtc/pkg/webrtc/conn.go:75 +0x6c
created by github.com/pion/webrtc/v3.(*PeerConnection).onConnectionStateChange
	github.com/pion/webrtc/[email protected]/peerconnection.go:492 +0x17c

calisro avatar Sep 04 '22 20:09 calisro

@AlexxIT still seeing this on beta 4.

*rtp.Header)(0x40007a7630)}}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1fa0b8]
goroutine 257 [running]:
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).RemoveConsumer(0x40001af1a0, {0x795a68?, 0x4000a35880})
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:111 +0x138
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler.func1({0x5dac20?, 0xb106d0?})
	github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:89 +0x74
github.com/AlexxIT/go2rtc/pkg/streamer.(*Element).Fire(...)
	github.com/AlexxIT/go2rtc/pkg/streamer/streamer.go:27
github.com/AlexxIT/go2rtc/pkg/webrtc.(*Conn).Init.func3(0x6)
	github.com/AlexxIT/go2rtc/pkg/webrtc/conn.go:75 +0x6c
created by github.com/pion/webrtc/v3.(*PeerConnection).onConnectionStateChange
	github.com/pion/webrtc/[email protected]/peerconnection.go:492 +0x17c

calisro avatar Sep 10 '22 11:09 calisro

This known problem is not fixed yet

AlexxIT avatar Sep 10 '22 12:09 AlexxIT

Should be fixed in v0.1-beta.10

AlexxIT avatar Nov 04 '22 17:11 AlexxIT

Similar problem

panic: runtime error: slice bounds out of range [1:0]

goroutine 103 [running]:
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).removeConsumer(0xc00009eea0, 0x0)
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:192 +0x37e
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).RemoveConsumer(0xc00009eea0, {0x1795fb8, 0xc0000c0070})
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:119 +0x46d
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler.func1({0x163f260, 0x1b72170})
	github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:93 +0xe7
github.com/AlexxIT/go2rtc/pkg/streamer.(*Element).Fire(0xc0000c0070, {0x163f260, 0x1b72170})
	github.com/AlexxIT/go2rtc/pkg/streamer/streamer.go:27 +0x8e
github.com/AlexxIT/go2rtc/pkg/webrtc.(*Conn).Init.func3(0x6)
	github.com/AlexxIT/go2rtc/pkg/webrtc/conn.go:74 +0x58
created by github.com/pion/webrtc/v3.(*PeerConnection).onConnectionStateChange
	github.com/pion/webrtc/[email protected]/peerconnection.go:492 +0x238

AlexxIT avatar Nov 04 '22 18:11 AlexxIT

Should be fixed in https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-rc.1

AlexxIT avatar Nov 04 '22 20:11 AlexxIT