{"action":"closed","issue":{"url":"https://api.github.com/repos/canndrew/tokio-utp/issues/1","repository_url":"https://api.github.com/repos/canndrew/tokio-utp","labels_url":"https://api.github.com/repos/canndrew/tokio-utp/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/canndrew/tokio-utp/issues/1/comments","events_url":"https://api.github.com/repos/canndrew/tokio-utp/issues/1/events","html_url":"https://github.com/canndrew/tokio-utp/issues/1","id":288138953,"node_id":"MDU6SXNzdWUyODgxMzg5NTM=","number":1,"title":"Addition overflow","user":{"login":"povilasb","id":1213442,"node_id":"MDQ6VXNlcjEyMTM0NDI=","avatar_url":"https://avatars3.githubusercontent.com/u/1213442?v=4","gravatar_id":"","url":"https://api.github.com/users/povilasb","html_url":"https://github.com/povilasb","followers_url":"https://api.github.com/users/povilasb/followers","following_url":"https://api.github.com/users/povilasb/following{/other_user}","gists_url":"https://api.github.com/users/povilasb/gists{/gist_id}","starred_url":"https://api.github.com/users/povilasb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/povilasb/subscriptions","organizations_url":"https://api.github.com/users/povilasb/orgs","repos_url":"https://api.github.com/users/povilasb/repos","events_url":"https://api.github.com/users/povilasb/events{/privacy}","received_events_url":"https://api.github.com/users/povilasb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-01-12T14:38:58Z","updated_at":"2018-06-11T13:53:39Z","closed_at":"2018-06-11T13:53:38Z","author_association":"CONTRIBUTOR","body":"Recently I received such error:\r\n>  thread 'main' panicked at 'attempt to add with overflow', /home/povilas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-utp-0.3.0/src/socket.rs:1377:25\r\n\r\nThat's nothing new: I know you already fixed the same for underflows. The issue this time is here: https://github.com/canndrew/tokio-utp/blob/master/src/socket.rs#L1377\r\n`self.average_delay_base += min_sample as u32;`\r\n\r\nBut actually it caught me by surprise, because `self.average_delay_base` is 32 bits long:\r\nhttps://github.com/canndrew/tokio-utp/blob/master/src/socket.rs#L170\r\n`average_delay_base: u32,` , hence it can hold values up to **4294967296**.\r\nAs far as I understand delays should be in microseconds: https://github.com/canndrew/tokio-utp/blob/master/src/packet.rs#L14\r\nTherefore, if this variable overflows, that means `average_delay_base` is ~**4000** seconds.\r\nBut I gotta say, I was running the tests for at most 60 seconds, hence such delay is impossible and this smells like a bug somewhere else, doesn't it?"}}
{"actor":{"display_login":"povilasb"}}