GNOME Bugzilla – Bug 648644
GHex2 cannot read properly float 64 in big-endian files
Last modified: 2011-09-16 20:17:26 UTC
Created attachment 186619 [details] big endian file format C double 64 bits type floating numbers cannot be read properly when it is encoded in big endian format, and read on little-endian platform the pointer has to be shifted 4 bytes forward to be able to "see" the right number in the attached file encoded in big-endian format, at position 0x10=16, there is the double number which should be roughly equal to 1538.383 in fact, it is read to be equal to 2,895473e-287 (but it is not the right value) you can "read" it properly if you are placed 4 bytes forward at position 0xC=12 my distribution : Fedora 14 x86_64 my PC : Intel Core2 Quad 9400 my Ghex rpm is : ghex-2.24.0-5.fc13.x86_64 if you can read french, see also : http://forums.fedora-fr.org/viewtopic.php?id=52188
Created attachment 186646 [details] little endian file format (with same data) attached file is filled with the same data, but recorded as little endian you can now compare the two files with Ghex the bug appears at byte # 0x10=16, and at least for the 99 following double numbers
Created attachment 186759 [details] double C type number read in little-endian file format (screen copy) double C type number read in little-endian file format pointer is at position 0x10=16 the number is equal to 1538.383 this is the right value related to attached file entitled 'little'
Created attachment 186761 [details] double C type number read in big-endian file format (screen copy) double C type number read in big-endian file format pointer is at position 0x10=16 the number is equal in this case to 2.895473e-287 (it should be equal to 1538.383) this is NOT the right value related to previously attached file entitled 'big'
Created attachment 186763 [details] double C type number read in big-endian file format 4 bytes backwards (screen copy) double C type number read in big-endian file format, but 4 bytes backwards pointer is now at position 0xC=12 (it should be 0x10=16, see below) the number is equal in this case to "expected" value 1538.383, but he pointer is NOT at the right place related to previously attached file entitled 'big'
GHex was largely unmaintained for several years, but I'm now working on getting a new release out. The sample files, screenshots and comments here are really good and helped me a lot when dealing with the issue. Thanks for taking the time to do that! I'm going to mark this ticket as a duplicate with #625968 just because they are both about the same bug and there's a patch in there. Make no mistake, all the work you did here played a big part to get this issue solved. *** This bug has been marked as a duplicate of bug 625968 ***
(In reply to comment #0) > my distribution : Fedora 14 x86_64 > > my Ghex rpm is : ghex-2.24.0-5.fc13.x86_64 Since you mentioned Fedora, you might want to give a try to the Fedora 16 build which has the fix: https://admin.fedoraproject.org/updates/ghex-2.90.2-1.fc16
now it works fine ;-) https://admin.fedoraproject.org/updates/FEDORA-2011-12456?_csrf_token=5ca0f4d32860007a9057ae2bf0eb8c7077b28502