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

fix crash when creating >2GB files on 32bit machine #189

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hyh19962008
Copy link

@hyh19962008 hyh19962008 commented Sep 16, 2023

appimagetool will crash on appimage_get_elf_section_offset_and_length() when creating file larger than 2GB on 32bit machine, because in this line lssek() returns -1 and errno set to EOVERFLOW. map_size with value UINT_MAX(-1) is then passed to mmap().

size_t map_size = (size_t) lseek(fd, 0, SEEK_END);

Adding "#define _FILE_OFFSET_BITS 64" will change off_t to 64bit, then we can get the correct file size from lseek.

related issues:
#21

AppImage/AppImageKit#1181

@hyh19962008 hyh19962008 changed the title allow max 4GB files to be created on 32bit machine fix crash when creating >2GB files on 32bit machine Sep 16, 2023
@hyh19962008
Copy link
Author

I was able to create files larger than 4GB now

@hyh19962008
Copy link
Author

hyh19962008 commented Oct 20, 2023

I made a build on Ubuntu 16.04(Xenial) for testing, it only works well on native 32bit system. Running it on a 64bit system still gets the same problem.
appimagetool-i686-4GBpatched.appimage

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

Successfully merging this pull request may close these issues.

None yet

1 participant