webrtc-rs/interceptor

Add with overflow panic

KallDrexx opened this issue · 1 comments

While idling the following panic occurred:

thread 'tokio-runtime-worker' panicked at 'attempt to add with overflow', /home/mshapiro/.cargo/registry/src/github.com-1ecc6299db9ec823/interceptor-0.7.6/src/report/sender/sender_stream.rs:35:23

I haven't been able to reproduce it so not sure what causes it, but something to look out for.

Based on the line number this seems to be the offending code: https://github.com/webrtc-rs/interceptor/blob/main/src/report/sender/sender_stream.rs#L35

It seems like last_rtp_time_rtp should be a Wrapping(u32) instead of u32, as my understanding is that RTP timestamps have a random starting offset and are allowed to wrap.

Observed a similar panic after ~20min of streaming:

thread 'actix-server worker 8' panicked at 'attempt to add with overflow', /Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/interceptor-0.7.6/src/report/sender/sender_stream.rs:28:9

Seems like the overflow happens on this other counter to https://github.com/webrtc-rs/interceptor/blob/main/src/report/sender/sender_stream.rs#L28. I'm not familiar with the internals of this crate, so take this with a grain of salt, but it's usually best to have at least 64 bits when keeping tracking of bytes transferred.

from Cargo.lock

[[package]]
name = "interceptor"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f9c57d39048948d61191cdbe2d3900560cbe0adc626fa51677fe1fb43ddfc8a"