server icon indicating copy to clipboard operation
server copied to clipboard

panic: runtime error: slice bounds out of range [:3524] with capacity 1500

Open nodomain opened this issue 4 years ago • 5 comments

While trying your cool solution both in a Docker environment and native on my EC2 box, it reproducedly crashes after some seconds of sharing my local screen to another local browser.

Config:

      SCREEGO_EXTERNAL_IP: "x.x.x.20"
      SCREEGO_TURN_ADDRESS: "0.0.0.0:443"
      SCREEGO_SERVER_ADDRESS: "0.0.0.0:80"
      SCREEGO_SECRET: "totallysecret"
      SCREEGO_TURN_PORT_RANGE: "50000:55000"
      SCREEGO_TURN_STRICT_AUTH: "false"
      SCREEGO_TRUST_PROXY_HEADERS: "true"
      SCREEGO_AUTH_MODE: "none"
      SCREEGO_CORS_ALLOWED_ORIGINS: "https://other.tld"
      SCREEGO_LOG_LEVEL: "debug"

Log:

ubuntu@ip-172-31-42-4:~/screego$ sudo ./screego serve
2021-02-18T14:49:11Z DBG Logger initialized
2021-02-18T14:49:11Z DBG Loading file /home/ubuntu/screego/screego.config
2021-02-18T14:49:11Z INF Users file not specified
2021-02-18T14:49:11Z DBG Using Port Range max=55000 min=50000
2021-02-18T14:49:11Z INF Start TURN/STUN addr=0.0.0.0:443
2021-02-18T14:49:11Z INF Start HTTP addr=0.0.0.0:80
2021-02-18T14:49:15Z DBG HTTP duration="345.412µs" host=host.tld ip=172.31.35.145:64080 path=/ size=2158 status=200
2021-02-18T14:49:15Z DBG HTTP duration=2.592104ms host=host.tld ip=172.31.35.145:64080 path=/static/css/main.08e397cf.chunk.css size=0 status=200
2021-02-18T14:49:15Z DBG HTTP duration=17.883149ms host=host.tld ip=172.31.35.145:64082 path=/static/js/2.6c008a11.chunk.js size=0 status=200
2021-02-18T14:49:15Z DBG HTTP duration=3.990749ms host=host.tld ip=172.31.35.145:64080 path=/static/js/main.4606f178.chunk.js size=0 status=200
2021-02-18T14:49:15Z DBG HTTP duration="46.64µs" host=host.tld ip=172.31.35.145:64082 path=/config size=70 status=200
2021-02-18T14:49:15Z DBG HTTP duration="548.608µs" host=host.tld ip=172.31.35.145:64082 path=/favicon.ico size=15086 status=200
2021-02-18T14:49:15Z DBG HTTP duration=10.723208ms host=host.tld ip=172.31.35.145:64082 path=/static/media/logo.d2ceaca5.svg size=0 status=200
2021-02-18T14:49:15Z DBG WebSocket New Connection id=c0n7squa08d27mvfd2ng ip=172.31.35.145
2021-02-18T14:49:15Z DBG HTTP duration="185.827µs" host=host.tld ip=172.31.35.145:64084 path=/stream size=0 status=0
2021-02-18T14:49:15Z DBG WebSocket Receive event=*ws.Join id=c0n7squa08d27mvfd2ng ip=172.31.35.145
2021-02-18T14:49:15Z DBG WebSocket Close code=1000 id=c0n7squa08d27mvfd2ng ip=172.31.35.145 reason="room with id obliged-beige-salamander does not exist"
2021-02-18T14:49:15Z DBG HTTP duration="125.84µs" host=172.31.42.4 ip=172.31.17.53:24862 path=/ size=2158 status=200
2021-02-18T14:49:16Z DBG HTTP duration="134.916µs" host=172.31.42.4 ip=172.31.35.145:64088 path=/ size=2158 status=200
2021-02-18T14:49:20Z DBG WebSocket New Connection id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:20Z DBG HTTP duration="177.001µs" host=host.tld ip=172.31.35.145:64082 path=/stream size=0 status=0
2021-02-18T14:49:20Z DBG WebSocket Receive event=*ws.Create id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:20Z DBG WebSocket Send event=room id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:24Z DBG HTTP duration="105.697µs" host=host.tld ip=172.31.35.145:64096 path=/ size=2158 status=200
2021-02-18T14:49:24Z DBG HTTP duration="95.075µs" host=host.tld ip=172.31.35.145:64096 path=/static/css/main.08e397cf.chunk.css size=0 status=200
2021-02-18T14:49:24Z DBG HTTP duration=3.70267ms host=host.tld ip=172.31.35.145:64098 path=/static/js/2.6c008a11.chunk.js size=0 status=200
2021-02-18T14:49:24Z DBG HTTP duration="188.866µs" host=host.tld ip=172.31.35.145:64096 path=/static/js/main.4606f178.chunk.js size=0 status=200
2021-02-18T14:49:25Z DBG HTTP duration="20.124µs" host=host.tld ip=172.31.35.145:64098 path=/config size=70 status=200
2021-02-18T14:49:25Z DBG HTTP duration="109.365µs" host=host.tld ip=172.31.35.145:64098 path=/favicon.ico size=15086 status=200
2021-02-18T14:49:25Z DBG HTTP duration=1.796977ms host=host.tld ip=172.31.35.145:64098 path=/static/media/logo.d2ceaca5.svg size=0 status=200
2021-02-18T14:49:25Z DBG WebSocket New Connection id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:25Z DBG HTTP duration="168.819µs" host=host.tld ip=172.31.35.145:64100 path=/stream size=0 status=0
2021-02-18T14:49:25Z DBG WebSocket Receive event=*ws.Join id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:25Z DBG WebSocket Send event=room id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:25Z DBG WebSocket Send event=room id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
turn ERROR: 2021/02/18 14:49:25 error when handling datagram: unable to handle ChannelData from 46.100.86.24:13778: no allocation found 46.100.86.24:13778:172.31.42.4:443
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.StartShare id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=clientsession id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostsession id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=room id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=room id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.HostOffer id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.HostICE id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.HostICE id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostoffer id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostice id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostice id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.HostICE id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostice id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG TURN authenticated addr=89.247.119.26:58526 realm=screego
2021-02-18T14:49:34Z DBG TURN allocated addr=[::]:53934 relayaddr=3.64.59.20:53934
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.HostICE id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=hostice id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.ClientAnswer id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=clientanswer id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.ClientICE id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=clientice id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:34Z DBG TURN authenticated addr=89.247.119.26:51089 realm=screego
2021-02-18T14:49:34Z DBG TURN allocated addr=[::]:54764 relayaddr=3.64.59.20:54764
2021-02-18T14:49:34Z DBG WebSocket Receive event=*ws.ClientICE id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:34Z DBG WebSocket Send event=clientice id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:35Z DBG WebSocket Receive event=*ws.HostICE id=c0n7stea08d27mvfd2og ip=172.31.35.145
2021-02-18T14:49:35Z DBG WebSocket Send event=hostice id=c0n7ss6a08d27mvfd2o0 ip=172.31.35.145
2021-02-18T14:49:45Z DBG HTTP duration="101.239µs" host=172.31.42.4 ip=172.31.17.53:24880 path=/ size=2158 status=200
2021-02-18T14:49:46Z DBG HTTP duration="115.434µs" host=172.31.42.4 ip=172.31.35.145:64114 path=/ size=2158 status=200
panic: runtime error: slice bounds out of range [:3524] with capacity 1500

goroutine 60 [running]:
github.com/pion/turn/v2.(*Server).readLoop(0xc000271a40, 0xd85b20, 0xc0001a10e0, 0xc00006afc0)
	/home/runner/go/pkg/mod/github.com/pion/turn/[email protected]/server.go:150 +0x3ac
created by github.com/pion/turn/v2.NewServer.func2
	/home/runner/go/pkg/mod/github.com/pion/turn/[email protected]/server.go:102 +0x1b2

nodomain avatar Feb 18 '21 14:02 nodomain

What browser / os are you using?

jmattheis avatar Feb 18 '21 18:02 jmattheis

Edge Version 88.0.705.74 (64-Bit) Chrome Version 88.0.4324.182 (x86_64) Mac 10.15.7 (19H524)

nodomain avatar Feb 18 '21 19:02 nodomain

Did you logged in and used turn for nat traversal?

jmattheis avatar Feb 19 '21 20:02 jmattheis

I deactivated login because the site is protected by other measures and used TURN (I think)

nodomain avatar Feb 19 '21 20:02 nodomain

Alright, I've created an issue on the library used for the turn server.

jmattheis avatar Feb 19 '21 20:02 jmattheis

Probably fixed with v1.10.1

jmattheis avatar Sep 22 '23 09:09 jmattheis