Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support large files on 32bit #26

Open
asgh opened this issue Jan 29, 2016 · 6 comments
Open

Please support large files on 32bit #26

asgh opened this issue Jan 29, 2016 · 6 comments

Comments

@asgh
Copy link

asgh commented Jan 29, 2016

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.)

Feh added a commit that referenced this issue Jan 30, 2016
When we set _FILE_OFFSET_BITS=64, then fopen64() is the same as fopen():
http://www.gnu.org/software/libc/manual/html_node/Opening-Streams.html#index-fopen64

This should help with issue #26.
@Feh
Copy link
Owner

Feh commented Jan 30, 2016

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.

@asgh
Copy link
Author

asgh commented Jan 31, 2016

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).

@Feh
Copy link
Owner

Feh commented Jan 31, 2016

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)?

@asgh
Copy link
Author

asgh commented Feb 2, 2016

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.)

@Fishkin
Copy link

Fishkin commented Dec 12, 2016

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 :)

guillemj added a commit to guillemj/nocache that referenced this issue Jun 10, 2024
This makes the project LFS and time64 aware so that it will internally
call the large APIs, and avoid failing due to files with large inode
numbers, or stat structures with large time values for example.

Fixes: Feh#26
@guillemj
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants