Giter Club home page Giter Club logo

Comments (5)

raboof avatar raboof commented on August 14, 2024

Interesting, might be an overflow - we count bytes - let's see if we can widen that type :)

from nethogs.

jantman avatar jantman commented on August 14, 2024

I'm pretty sure this is an overflow since we're using uint32_t to count bytes, and maximum for that type (2^32 - 1) works out to be approximately 4.2GB (and regardless of what view you specify, the totals are stored as bytes and converted to the unit you asked for). That's stored per connection, but it's also summed per process... so I think it's quite likely that (especially on a busy server or a desktop with a process that's doing a lot of network IO like a game, torrent client, single-process browser, or streaming video) it can wrap around - that will happen with any process that sends or receives more than 4.2 GB.

If we bumped all of the total bytes counters from uint32_t to uint64_t, we'd end up consuming a bit more memory (an additional 64 bytes per connection, plus some program-wide overhead for summing) and change the public API of libnethogs, but we'd be able to count 2^64 - 1 bytes, or 18.4 exabytes (that's 18,446,744.1 terabytes) before wrapping around.

from nethogs.

raboof avatar raboof commented on August 14, 2024

Sounds like a good idea to me!

from nethogs.

jantman avatar jantman commented on August 14, 2024

Ok, I'll give a try at a PR for this one once I get some feedback on my other open PRs; this is going to change a lot of variable types, so it would be a rather painful rebase.

from nethogs.

raboof avatar raboof commented on August 14, 2024

Thanks for this fix @jantman

from nethogs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.