Giter Site home page Giter Site logo

martinellimarco / t2sz Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 0.0 586 KB

Compress a file into a seekable zstd with special handling for .tar archives

License: GNU General Public License v3.0

CMake 6.64% C 85.76% Shell 7.60%
compression seekable tools zstd

t2sz's Issues

Threading does not appear to work

Using the latest git commit, the -T option simply doesn't appear to work. t2sz will use only a single thread according to htop no matter how high I set it. This happens with -s and -S set to both high or low values, as well as without them set.

I am on Solus using zstd 1.5.2.

Memory corruption

git clone --depth=1 --single-branch https://github.com/stedolan/jq
tar -cf jq.tar -- jq
t2sz -vfo jq.tar.zst -- jq.tar

+ <null>
# END OF BLOCK (512)

+ <null>
# END OF BLOCK (512)

munmap_chunk(): invalid pointer
[1]    164384 abort (core dumped)  t2sz -vfo jq.tar.zst -- jq.tar

# OR:(sometimes): free(): invalid pointer
──────
(gdb) bt
#0  0x00007ffff7d2eef5 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7d18862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff7d70f38 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff7d78bea in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff7d7901c in munmap_chunk () from /usr/lib/libc.so.6
#5  0x00007ffff7d7dcdb in free () from /usr/lib/libc.so.6
#6  0x00005555555552bc in main (argc=<optimized out>, argv=<optimized out>) at /home/user/.cache/aurutils/airy/t2sz-git/src/t2sz/src/t2sz.c:372
──────
(gdb) f 6
#6  0x00005555555552bc in main (argc=<optimized out>, argv=<optimized out>) at /home/user/.cache/aurutils/airy/t2sz-git/src/t2sz/src/t2sz.c:372
372         free(ctx->outFilename);
──────
(gdb) l
367             }
368         }
369
370         compressFile(ctx);
371
372         free(ctx->outFilename);
373         free(ctx);
374
375         return 0;
376     }
──────
(gdb)
==167002== Invalid free() / delete / delete[] / realloc()
==167002==    at 0x483F9AB: free (vg_replace_malloc.c:538)
==167002==    by 0x1092BB: main (t2sz.c:372)
==167002==  Address 0x1fff000109 is on thread 1's stack

Allow using stdin

Currently t2sz mmaps the input file, so it has to be a physical file. This makes t2sz difficult to use in pipelines, where some stream is generated and needs to be compressed, but we don't want the uncompressed stream persisted to disk.

There's no particular reason we couldn't just read blocks into a buffer, though.

Usability for non-tar archives

It might be nice to be able to run t2sz against non-tar-format files, eg: t2sz image.ext4 -o image.ext4.sz. It'd be useful for mounting disk images with ratarmount, for example. My tool pixz allows this sort of thing for writing indexed xz files, and I'd love to see the same functionality for zstd.

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.