Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34872 - unrar-3.2.2 doesn't work correctly in 64bit env. on amd64
Summary: unrar-3.2.2 doesn't work correctly in 64bit env. on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-02 01:36 UTC by Marcus Stjärnås
Modified: 2004-01-08 14:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for 64-bit bug (unrar-64bit-fixes.patch,475 bytes, patch)
2004-01-04 15:41 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Stjärnås 2003-12-02 01:36:24 UTC
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.
Comment 1 Marcus Stjärnås 2003-12-06 00:42:07 UTC
Just found out that FreeBSD has the same problem on their sparc 64bit port.

http://www.freebsd.org/cgi/query-pr.cgi?pr=57800
Comment 2 Daniel Ahlberg (RETIRED) gentoo-dev 2004-01-02 11:31:54 UTC
I've bumped unrar to 3.3.3, could you test if the problem still exist?
Comment 3 Marcus Stjärnås 2004-01-02 12:19:19 UTC
Same problem still exist.
Comment 4 Ryan C. Gordon 2004-01-04 15:40:33 UTC
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.
Comment 5 Ryan C. Gordon 2004-01-04 15:41:26 UTC
Created attachment 23169 [details, diff]
Fix for 64-bit bug
Comment 6 Marcus Stjärnås 2004-01-08 12:49:43 UTC
The fix works fine for me too. Would be nice to see this patch in portage soon, soo we can close this bug.
Comment 7 Kris Kersey (RETIRED) gentoo-dev 2004-01-08 14:04:38 UTC
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.