Apache OpenOffice (AOO) Bugzilla – Issue 70132
Binary resource files differ between platforms
Last modified: 2013-08-07 15:34:42 UTC
This is a follow up issue for #i53727#. Binary *.res files differ in contents between platforms. I compared hexdump -C of all resources I have in my cs build for GNU/Linux with the same files from Windows (the same build). The result is attached. The typical difference looks like this: diff -urN Linux/abp680cs.res.hexdump Windows/abp680cs.res.hexdump --- Linux/abp680cs.res.hexdump 2006-10-05 15:03:54.000000000 +0200 +++ Windows/abp680cs.res.hexdump 2006-10-05 15:04:23.000000000 +0200 @@ -1,5 +1,5 @@ 00000000 00 00 4d 30 00 00 01 11 00 00 00 18 00 00 00 18 |..M0............| -00000010 41 64 72 65 73 79 00 41 00 00 4d 31 00 00 01 11 |Adresy.A..M1....| +00000010 41 64 72 65 73 79 00 00 00 00 4d 31 00 00 01 11 |Adresy....M1....| 00000020 00 00 00 2e 00 00 00 2e 56 79 74 76 6f c5 99 69 |........VytvoĹ.i| 00000030 74 20 64 61 74 61 62 c3 a1 7a 69 20 6b 6f 6e 74 |t databÄ‚Ä„zi kont| 00000040 61 6b 74 c5 af 00 00 00 4d 32 00 00 01 11 00 00 |aktĹŻ...M2......| @@ -296,7 +296,7 @@ 00001270 00 00 01 02 00 00 08 70 00 00 00 10 00 00 01 10 |.......p........| 00001280 00 00 01 11 00 00 00 1a 00 00 00 1a 52 65 73 6f |............Reso| 00001290 75 72 63 65 00 00 00 00 01 11 00 00 01 11 00 00 |urce............| -000012a0 00 18 00 00 00 18 53 74 72 69 6e 67 00 80 00 00 |......String....| +000012a0 00 18 00 00 00 18 53 74 72 69 6e 67 00 00 00 00 |......String....| 000012b0 01 79 00 00 01 11 00 00 00 1c 00 00 00 1c 53 74 |.y............St| 000012c0 72 69 6e 67 41 72 72 61 79 00 00 00 01 13 00 00 |ringArray.......| 000012d0 01 11 00 00 00 18 00 00 00 18 42 69 74 6d 61 70 |..........Bitmap| The first one is 0x41 -> 0x00, the second one is 0x80 -> 0x00. But there are also other differences like: diff -urN Linux/analysis680cs.res.hexdump Windows/analysis680cs.res.hexdump --- Linux/analysis680cs.res.hexdump 2006-10-05 15:03:55.000000000 +0200 +++ Windows/analysis680cs.res.hexdump 2006-10-05 15:04:23.000000000 +0200 @@ -24,7 +24,7 @@ 00000170 61 6d 20 64 61 74 20 76 6f 6c 6e c3 bd 63 68 20 |am dat volnÄ‚Ëch | 00000180 64 6e c3 ad 20 28 76 c3 bd 7a 6e 61 6d 6e c3 a9 |dnÄ‚Â (vÄ‚ËznamnÄ‚Å | 00000190 20 64 6e 79 2c 20 73 76 c3 a1 74 6b 79 20 61 70 | dny, svÄ‚Ä„tky ap| -000001a0 6f 64 2e 29 00 72 00 00 03 e9 00 00 01 10 00 00 |od.).r...é......| +000001a0 6f 64 2e 29 00 fe 00 00 03 e9 00 00 01 10 00 00 |od.).Å£...é......| 000001b0 01 4e 00 00 00 10 00 00 00 01 00 00 01 11 00 00 |.N..............| 000001c0 00 60 00 00 00 60 56 72 61 63 c3 ad 20 70 6f c4 |.`...`VracÄ‚Â poÄ| 000001d0 8d 65 74 20 64 6e c3 ad 20 6d 65 7a 69 20 27 76 |.et dnÄ‚Â mezi 'v| 0x72 -> 0xfe What is the source of this difference?
Created attachment 39587 [details] diff of resources
I don't know the exact origin, but i think this is uninitialized memory in places where it does not matter: see e.g. rsc/source/tools/rsctools.cxx in RscWriteRc::PutUTF8. That function increases the stream 2byte aligned, puts a UTF-8 string in it and terminates with a '0'. If however the string length was already even (that is the terminating 0 is in an odd byte), then the last byte is allocated but not set - which does not matter in the file format since the string will be read correctly anyway or skipped by the correct offset if necessary. FYI: resources are actually platform independent already and the (sun provided) windows builds actually use res files that were built on Linux and/or Solaris.
Dear developers, any progress with this one?
target
Reset assignee on issues not touched by assignee in more than 2000 days.