livego icon indicating copy to clipboard operation
livego copied to clipboard

推流报错

Open lijunhui1999 opened this issue 3 years ago • 10 comments

rtmp read packet panic: runtime error: slice bounds out of range [:7292246]

lijunhui1999 avatar Jun 10 '21 07:06 lijunhui1999

please add most stack info

matthewgao avatar Jul 06 '21 02:07 matthewgao

INFO:2021/07/08 17:52:56 main.go:768: sqlD:/GoLand/src/pm-easydarwin/vendor/github.com/penggy/sessions/gormstore.go:1960sDELETE FROM "t_sessions" WHERE (expires_at <= ?)[2021-07-08 17:52:56.14361 +0800 CST m=+8426.504771001] 0 INFO:2021/07/08 17:53:11 main.go:768: sqlD:/GoLand/src/pm-easydarwin/vendor/github.com/penggy/sessions/gormstore.go:1960sDELETE FROM "t_sessions" WHERE (expires_at <= ?)[2021-07-08 17:53:11.1436714 +0800 CST m=+8441.504832401] 0 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:15880483] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:6396953] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:14253579] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:796644] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:11516371] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:10835507] with capacity 512000 ERROR:2021/07/08 17:53:15 rtmp.go:432: rtmp read packet panic: runtime error: slice bounds out of range [:4748115] with capacity 512000 INFO:2021/07/08 17:53:15 stream.go:225: StopStaticPush......live/LIJUNHUI7 ERROR:2021/07/08 17:53:15 stream.go:238: rtmp推流数据已断开:LIJUNHUI7 INFO:2021/07/08 17:53:15 main.go:768: sqlD:/GoLand/src/pm-easydarwin/rtsp/rtsp-server.go:242745.7µsSELECT * FROM "t_stream_records" WHERE ("t_stream_records"."stream_id" = ?) ORDER BY "t_stream_records"."id" ASC LIMIT 1[LIJUNHUI7] 1 INFO:2021/07/08 17:53:15 main.go:768: sqlD:/GoLand/src/pm-easydarwin/rtsp/rtsp-server.go:245997.9µsUPDATE "t_stream_records" SET "stream_id" = ?, "file_sufix" = ?, "src_path" = ?, "file_path" = ?, "mp4_path" = ?, "create_time" = ?, "stop_time" = ?, "state" = ?, "cur_idx" = ? WHERE "t_stream_records"."id" = ?[LIJUNHUI7 m3u8 rtmp://192.168.1.95:1935/live/LIJUNHUI7 /LIJUNHUI7/20210708/LIJUNHUI7_0.m3u8 2021-07-08 17:11:29 2021-07-08 17:53:15 0 0 aQmhhninR] 1 INFO:2021/07/08 17:53:15 stream.go:240: StopStaticPush: current streamname=LIJUNHUI7, appname=live ERROR:2021/07/08 17:53:15 stream.go:243: StopStaticPush: GetStaticPushList error=no static push url INFO:2021/07/08 17:53:15 stream.go:430: [<key: live/LIJUNHUI7, URL: rtmp://192.168.1.95:1935/live/LIJUNHUI7, UID: EDKFoudXS8mTOZ7A, Inter: false>] publisher closed

lijunhui1999 avatar Jul 08 '21 10:07 lijunhui1999

ERROR:2021/07/08 18:06:26 rtmp.go:476: publisher <key: live/LIJUNHUI6, URL: rtmp://192.168.1.95:1935/live/LIJUNHUI6, UID: At0c9xnHTNSGRS6Y, Inter: false> closed: read timeout INFO:2021/07/08 18:06:26 stream.go:225: StopStaticPush......live/LIJUNHUI6 ERROR:2021/07/08 18:06:26 stream.go:238: rtmp推流数据已断开:LIJUNHUI6 time="2021-07-08T18:06:26+08:00" level=info msg="write timeout remove" ERROR:2021/07/08 18:06:26 rtmp.go:377: player <key: live/LIJUNHUI6, URL: rtmp://192.168.1.95:1935/live/LIJUNHUI6?timestamp=22, UID: W55QARKZQkCtfex3, Inter: true> closed: write timeout ERROR:2021/07/08 18:06:26 rtmp.go:226: closed time="2021-07-08T18:06:26+08:00" level=info msg="write timeout remove" 有的时候这个也会莫名断开推流

lijunhui1999 avatar Jul 08 '21 10:07 lijunhui1999

I noticed this too. It happens randomly. Maybe it is due to congestion?

onthegit avatar Jul 16 '21 00:07 onthegit

我也注意到了这一点。它是随机发生的。也许是因为拥挤?

不是随机的,如果有2K视频传入也会出现 rtmp read packet panic: runtime error: slice bounds out of range [:15880483] with capacity 512000

lijunhui1999 avatar Jul 16 '21 03:07 lijunhui1999

请添加大多数堆栈信息

已经发出来了

lijunhui1999 avatar Jul 16 '21 03:07 lijunhui1999

我也注意到了这一点。它是随机发生的。也许是因为拥挤?

不是随机的,如果有2K视频传入也会出现 rtmp read packet panic: runtime error: slice bounds out of range [:15880483] with capacity 512000

It happens with other videos too with less than 2K. It happens randomly.

onthegit avatar Jul 16 '21 15:07 onthegit

我也注意到了这一点。它是随机发生的。也许是因为拥挤?

不是随机的,如果有2K视频传入也会出现 rtmp read packet panic: runtime error: slice bounds out of range [:15880483] with capacity 512000

It happens with other videos too with less than 2K. It happens randomly.

yes

lijunhui1999 avatar Jul 19 '21 01:07 lijunhui1999

类似的问题,我也遇到了,微信小程序推送音频流,微信小程序连接时,声明的SetChunkSize大小是256,但是小程序实际发送过来的音频包中的RTMP message Body size的大小会超过256,出现类似panic的情况。livego对这种异常的情况没有做处理,导致崩溃,崩溃概率还是挺高的。我暂时还不知道怎么解决

xianchuhan avatar Sep 11 '21 05:09 xianchuhan

我也注意到了这一点。它是随机发生的。也许是因为拥挤?

不是随机的,如果有2K视频传入也会出现 rtmp read packet panic: runtime error: slice bounds out of range [:15880483] with capacity 512000

const maxpoolsize = 500 * 1024 just guess, try to increase the pool size? this may exceed the maxpoolsize

matthewgao avatar Oct 14 '21 11:10 matthewgao