Bug 324048 (MONO81368) - [ARM9] Endian issues with doubles
Summary: [ARM9] Endian issues with doubles
Status: RESOLVED FIXED
Alias: MONO81368
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Paolo Molaro
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 14:15 UTC by Lixin Chin
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
C# source which causes the error (1.39 KB, text/plain)
2007-04-13 14:16 UTC, Thomas Wiest
Details
The same C# source but compiled using mcs for arm9 (4.00 KB, application/octet-stream)
2007-04-13 14:16 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:35:26 UTC


---- Reported by lchin@erggroup.com 2007-04-13 07:15:13 MST ----

Please fill in this template when reporting a bug, unless you know what you
are doing.

***Description of Problem***:
There are endian problems between a compiled version of mono for arm9 and
the same version for the i386. This ONLY happens when using Attribute's
(System.Reflection.Attribute) NOT when storing local / constant variables.

The i386 version of mono stores doubles in the same format as the c#
compiler included with the 1.1 MS .NET Framework.

The arm9 version of mono however, wordswaps all doubles. This means that
eg. double constants defined in an i386 compiled .NET binary will end up
wordswapped when run on arm9 and vice versa.


***Steps to reproduce the problem***:
I've attached some code which shows the problem.

- Compile under i386, run under ARM
- Or Compile under ARM and run under i386

***Actual Results***:
5
attr.long   = 1
attr.double = 5.30498947741318E-315
attr.string = 3
attr.long   = 2
attr.double = 5.31017013119972E-315
attr.string = 6

***Expected Results***:
5
attr.long   = 1
attr.double = 2
attr.string = 3
attr.long   = 2
attr.double = 4
attr.string = 6

***How often does this happen? ***
100%

***Additional Information***:
This ONLY happens when using Attribute's (System.Reflection.Attribute) NOT
when storing local / constant variables.



---- Additional Comments From lchin@erggroup.com 2007-04-13 07:16:05 MST ----

Created an attachment (id=171783)
C# source which causes the error




---- Additional Comments From lchin@erggroup.com 2007-04-13 07:16:43 MST ----

Created an attachment (id=171784)
The same C# source but compiled using mcs for arm9




---- Additional Comments From lchin@erggroup.com 2007-04-13 07:19:01 MST ----

I filed this bug under the JIT, but it also affects the C# compiler as
well, since compiling under ARM9 and running under i386 (using mono or
the MS .NET framework) also triggers the bug.

Notably, compiling and running code using the same hardware platform
(all i386 or all arm9) works fine.



---- Additional Comments From lupus@ximian.com 2007-04-18 13:07:01 MST ----

Fixed in svn, thanks for the test case.

Imported an attachment (id=171783)
Imported an attachment (id=171784)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>linux on i386 / linux on ARM9</cf_op_sys_details>
Unknown operating system other. Setting to default OS "Other".