I tried unpack my old dvd movies (packed with winrar) on my new amd64 system and it fails. If i boot (the same computer) in 32bit enviroment they will unpack correctly. This error seems only exist if the packed file is big (>~3gib). Smaller files unpacks correctly. Reproducible: Always Steps to Reproduce: 1. Build unrar-3.2.2.ebuild in 64bit enviroment. 2. unrar a rar-set of >60 rar-files containing one file bigger than 4gig 3. Actual Results: Crc will fail, and the unpacked file will be corrupt. Expected Results: If I boot with a 32bit kernel with a 32bit compiled unrar it works perfectly with the exact same files. Smaller (<~2gig) files will unpack correctly in 64bit enviroment.
Just found out that FreeBSD has the same problem on their sparc 64bit port. http://www.freebsd.org/cgi/query-pr.cgi?pr=57800
I've bumped unrar to 3.3.3, could you test if the problem still exist?
Same problem still exist.
Okay, I tracked this one down. It's not due to large files (I generated a 4+ gig file from /dev/urandom with the 32-bit version and it unpacked fine with a 64-bit build), nor does it have to do with a specific compression method like the FreeBSD sparc64 bug report mentions. It's actually a dumb mistake: they use a long (64-bit on amd64, 32-bit on ia32) where integer overflow was relevant. My testing hasn't been extensive, but I believe the attached patch will fix all the 64-bit issues that have reported. I'll follow up with FreeBSD and the original author, too. --ryan.
Created attachment 23169 [details, diff] Fix for 64-bit bug
The fix works fine for me too. Would be nice to see this patch in portage soon, soo we can close this bug.
Commited. The patch looks good and still works on all the files that I had. I could not produce the error so those that could should test this new build.