go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

Beta 6 broken- panic slice bounds out of range

Open calisro opened this issue 3 years ago • 7 comments

Latest beta 6 won't run at all. COnstant panics. Had to roll back.

2022/09/17 14:52:00 http: panic serving 127.0.0.1:37908: runtime error: slice bounds out of range [8:7]
goroutine 25 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1825 +0xb8
panic({0x69af60, 0x4000036198})
	runtime/panic.go:844 +0x260
github.com/AlexxIT/go2rtc/cmd/hass.initAPI.func3({0x7dd5b0, 0x400007c620}, 0x4000032a00)
	github.com/AlexxIT/go2rtc/cmd/hass/api.go:57 +0x52c
net/http.HandlerFunc.ServeHTTP(0x72?, {0x7dd5b0?, 0x400007c620?}, 0x1cd20?)
	net/http/server.go:2084 +0x3c
net/http.(*ServeMux).ServeHTTP(0x0?, {0x7dd5b0, 0x400007c620}, 0x4000032a00)
	net/http/server.go:2462 +0x144
net/http.serverHandler.ServeHTTP({0x400007e600?}, {0x7dd5b0, 0x400007c620}, 0x4000032a00)
	net/http/server.go:2916 +0x408
net/http.(*conn).serve(0x400031cf00, {0x7ddc40, 0x400007e0c0})
	net/http/server.go:1966 +0x550
created by net/http.(*Server).Serve
	net/http/server.go:3071 +0x448

calisro avatar Sep 17 '22 18:09 calisro

same for me, also had to revert back.

rogerquake avatar Sep 17 '22 22:09 rogerquake

You need to restart RTSPtoWebRTC integration

AlexxIT avatar Sep 17 '22 22:09 AlexxIT

thanks, works after that!

rogerquake avatar Sep 17 '22 23:09 rogerquake

Yes that did the trick.

calisro avatar Sep 18 '22 01:09 calisro

But I still see them fairly frequently..

panic: runtime error: slice bounds out of range [:8192] with capacity 4096
goroutine 500 [running]:
bufio.(*Reader).ReadSlice(0x4000460ea0, 0xc?)
	bufio/bufio.go:346 +0x230
bufio.(*Reader).ReadLine(0x4000460ea0)
	bufio/bufio.go:400 +0x28
net/textproto.(*Reader).readLineSlice(0x400009fe20)
	net/textproto/reader.go:57 +0x7c
net/textproto.(*Reader).ReadLine(...)
	net/textproto/reader.go:38
github.com/AlexxIT/go2rtc/pkg/tcp.ReadRequest(0x4000460ea0)
	github.com/AlexxIT/go2rtc/pkg/tcp/textproto.go:115 +0x68
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Handle(0x4000106f70)
	github.com/AlexxIT/go2rtc/pkg/rtsp/conn.go:628 +0x11c
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Start(0x4000106f70)
	github.com/AlexxIT/go2rtc/pkg/rtsp/streamer.go:37 +0x9c
github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).start.func1()
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:93 +0x34
created by github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).start
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:92 +0x168

calisro avatar Sep 18 '22 20:09 calisro

I started seeing these again and restarting/removing/re-adding the RTSPtoWebRTC doesn't seem to help. The only difference though is the ip is different now. Its the docker ips...

  "camera.kitchen_display": 
    - "{input}"
    - ffmpeg:{input}#audio=opus
2022/10/06 10:31:27 http: panic serving 172.30.33.9:44268: runtime error: slice bounds out of range [:-1]
goroutine 13 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1825 +0xb8
panic({0x6ab5a0, 0x4000584120})
	runtime/panic.go:844 +0x260
github.com/AlexxIT/go2rtc/cmd/streams.GetProducer({0x4000137c78, 0x7})
	github.com/AlexxIT/go2rtc/cmd/streams/handlers.go:30 +0xec
github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).GetMedias(0x40001d76c0)
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:46 +0x12c
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).AddConsumer(0x40001aeff0, {0x7edb10?, 0x400020c1c0})
	github.com/AlexxIT/go2rtc/cmd/streams/stream.go:63 +0x2c8
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler(0x40000e61c0, 0x4000098040)
	github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:109 +0x408
github.com/AlexxIT/go2rtc/cmd/api.apiWS({0x7ee890, 0x4000206000}, 0x4000032100)
	github.com/AlexxIT/go2rtc/cmd/api/api.go:131 +0x198
net/http.HandlerFunc.ServeHTTP(0x72?, {0x7ee890?, 0x4000206000?}, 0x1cd20?)
	net/http/server.go:2084 +0x3c
net/http.(*ServeMux).ServeHTTP(0x400026800c?, {0x7ee890, 0x4000206000}, 0x4000032100)
	net/http/server.go:2462 +0x144
net/http.serverHandler.ServeHTTP({0x4000540090?}, {0x7ee890, 0x4000206000}, 0x4000032100)
	net/http/server.go:2916 +0x408
net/http.(*conn).serve(0x40002b4000, {0x7eef20, 0x40000900c0})
	net/http/server.go:1966 +0x550
created by net/http.(*Server).Serve
	net/http/server.go:3071 +0x448

Seems I get similar with any reference now to localhost/127.0.0.1... I am using the HA addon on HAOS.

calisro avatar Oct 06 '22 14:10 calisro

I'm seeing the same error: slice bounds out of range, but seemingly only when I add an rtsp stream off my udm pro (g3 instant and g4 doorbell)

version: 0.1-beta.8

jtauke avatar Oct 14 '22 20:10 jtauke

slice bounds out of range [:-1] - will be fixed in next release slice bounds out of range [8:7] - will be fixed in next release slice bounds out of range [:8192] with capacity 4096 - described in other issue

AlexxIT avatar Nov 04 '22 19: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