GithubHelp home page GithubHelp logo

Integer overflow with huge files about dua-cli HOT 4 CLOSED

byron avatar byron commented on July 29, 2024 2
Integer overflow with huge files

from dua-cli.

Comments (4)

Freaky avatar Freaky commented on July 29, 2024 1

Test environment:

 ❯ truncate -s 9223372036854775807 huge/{1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}

Before:

 ❯ dua -A huge
  18.45 EB huge

After:

❯ dua -A huge
   8.30 ZB huge

from dua-cli.

Byron avatar Byron commented on July 29, 2024 1

Wonderful! I wasn't aware that truncate could also create files - thus far I was just using it for removing a trailing newlines using -s -1 😅.
Amazing.

Closing this issue as the PR fixing it was merged.

from dua-cli.

Byron avatar Byron commented on July 29, 2024

You have just shattered my idea that nobody, ever, would hit the limits of u64, who can fit the amount of stars in the known universe multiple times and all :D. Probably that idea of mines is quite similar to that other one, along the lines of "640kb of main memory is going to be enough" :D.

Out of curousity: How did you produce these files? Are they actually backed by that much disk space?

To the point: I think it would not be an issue to represent the final aggregation as u128.
Would you be interested in giving that a shot?

from dua-cli.

Freaky avatar Freaky commented on July 29, 2024
 ❯ truncate -s 9223372036854775807 huge1
 ❯ l huge1
.rw-r--r-- 9.2E freaky freaky  1 Jul 15:56 huge1

They're sparse files and consume no more space than an empty file.

I'll have a look and see if I get bored before I finish fixing the compiler errors ;)

from dua-cli.

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.