nocache icon indicating copy to clipboard operation
nocache copied to clipboard

Please support large files on 32bit

Open asgh opened this issue 9 years ago • 6 comments

If you use cachestats or cachedel on a large file with a 32 bit build of the tool it says:

open: Value too large for defined data type

nocache runs, but actually does nothing, the file is still cached at the end.

I tried installing the 64 bit version of the tool, and running a 32 bit command but it says:

ERROR: ld.so: object '/usr/lib/nocache/nocache.so' from
LD_PRELOAD cannot be preloaded: ignored.

(If it matters this is version 0.9-2 on Debian.)

asgh avatar Jan 29 '16 19:01 asgh

I don’t have a 32 bit system at hand to try this out. Could you recompile (make clean all) using the referenced commit and see if this fixes the issue? Thanks.

Feh avatar Jan 30 '16 02:01 Feh

I tried it and cachestats and cachedel work. But nocache does not. Large files still get cached, while small ones do not.

Also, it's not a 32 bit system, just 32 bit programs inside a 64 bit system so you might be able to cross compile or install Debootstrap (if you are on Debian).

asgh avatar Jan 31 '16 02:01 asgh

Okay, so it’s a first step. I’ll try compiling some 32 bit binary when I have the time. Meanwhile, as per the README, have you tried nocache -n 2 (or, for that matter, -n 4)?

Feh avatar Jan 31 '16 09:01 Feh

Just (actually 2 days ago, but forgot to click the Comment button) tried -n, didn't change anything. (I don't need it with small files, so I didn't expect it to change anything.)

asgh avatar Feb 02 '16 07:02 asgh

Regarding the original comment with the 64-bit error, the proper way to do this in a multi-arch system like Debian/Ubuntu/Mint (other distros have similar, but different directory schemes) is to just put the 32bit and 64bit nocache.so into /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu respectively. It will automatically pick up the "nocache.so" matching the architecture of the loaded executable on preload.

Hopefully now, it's easier to test this on a 64-bit machine. I don't know of other distros or what Feh uses, though, so you'll have to do a little digging then.

This is very useful to use with 32-bit programs like wine's and nocache (doesn't matter if system is 64-bit), so please consider it for large files if it's possible.

Of course, the LD_PRELOAD should not be the full path! But just "nocache.so", i.e.:

export LD_PRELOAD="nocache.so $LD_PRELOAD"

And after placing them manually don't forget to run sudo ldconfig :)

Fishkin avatar Dec 12 '16 13:12 Fishkin

@asgh Hey! Perhaps you could give the referenced PR a try to see whether that fully solves your issues?

guillemj avatar Jun 10 '24 13:06 guillemj