Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Can't create RPM greater than 2 GB #96

Open
peterfrostdavid opened this issue Jan 6, 2017 · 5 comments
Open

Can't create RPM greater than 2 GB #96

peterfrostdavid opened this issue Jan 6, 2017 · 5 comments
Assignees
Labels

Comments

@peterfrostdavid
Copy link

RpmWriter.finish() uses FileChannel.transferTo() to move data from a temporary file to the final RPM file. When the temporary file is greater than 2 GB, only 2GB of data are transferred. StackOverflow has some discussions about transferTo() and the 2GB size limit that seem to confirm the theory that the truncation is happening in FileChannel.transferTo().

@ctron
Copy link
Contributor

ctron commented Jan 13, 2017

Sorry for the late reply on this. I am pretty busy with other stuff.

I will check this out. I am not sure this would be only issue with files +2GB though. If you have some experience, I would appreciate your help.

@ctron
Copy link
Contributor

ctron commented Jan 13, 2017

Could you maybe provide a simple, reproducible code snippet for that?

@ctron ctron added the bug label Jan 13, 2017
ctron added a commit that referenced this issue Jan 13, 2017
Actually the transferTo method must be called in a loop as it seems not
to be guaranteed that all content is transferred in one call.
@ctron
Copy link
Contributor

ctron commented Jan 13, 2017

I tried to create a fix for that. Thanks to your stackoverflow link it was pretty easy to find out what I made wrong.

I created a manual build of this single bundle [1], as I don't have a real way to test it right now, it would be awesome if you could give it a try and let me know if this solved your issue.

[1] https://web.tresorit.com/l#GnCGiReydabQ24DGdp3NkA

@peterfrostdavid
Copy link
Author

I tested the fix by invoking the new code indirectly through the de.dentrassi.maven.rpm Maven plugin and it successfully created a .rpm file larger than 2GB (the file created was 2487127517 bytes). I can no longer reproduce the problem, so I believe the fix works. At least on my system and use case.

@ctron
Copy link
Contributor

ctron commented Jan 18, 2017

Cool. Thanks.

I will try to get out an update ASAP. However I cannot make any promises for this or next week.

@ctron ctron self-assigned this Jan 18, 2017
ctron added a commit that referenced this issue Apr 6, 2017
Actually the transferTo method must be called in a loop as it seems not
to be guaranteed that all content is transferred in one call.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants