Bug 12144 - maybe a float computing bug.
Summary: maybe a float computing bug.
Status: NEEDINFO
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-07 18:37 UTC by tangjfn
Modified: 2018-01-18 22:01 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 12144 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description tangjfn 2013-05-07 18:37:20 UTC
I have install mono-2.11.4 on a powerpc e300c3.

When I try to load an X509Certificate, I get an ArgumentOutOfRangeException at DateTime.cs in function AddMilliseconds.

When I replace the mscorlib.dll with that I have compiled under x86 linux, It works.

So, I am not sure it's a runtime bug or a compiler bug.

Maybe a bootstrap mcs bug.
Comment 1 tangjfn 2013-05-08 11:12:26 UTC
mscorlib.dll compiled use i386

.method public hidebysig instance valuetype System.DateTime 
        AddMilliseconds(float64 'value') cil managed
{
  // 代码大小       82 (0x52)
  .maxstack  2
  .locals init (int64 V_0)
  IL_0000:  ldarg.1
  IL_0001:  ldc.r8     10000.
  IL_000a:  mul
  IL_000b:  ldc.r8     9.2233720368547758e+018
  IL_0014:  bgt        IL_0032
  IL_0019:  ldarg.1
  IL_001a:  ldc.r8     10000.
  IL_0023:  mul
  IL_0024:  ldc.r8     -9.2233720368547758e+018
  IL_002d:  bge.un     IL_0038
  IL_0032:  newobj     instance void System.ArgumentOutOfRangeException::.ctor()
  IL_0037:  throw
  IL_0038:  ldarg.1
  IL_0039:  ldc.r8     10000.
  IL_0042:  mul
  IL_0043:  call       float64 System.Math::Round(float64)
  IL_0048:  conv.i8
  IL_0049:  stloc.0
  IL_004a:  ldarg.0
  IL_004b:  ldloc.0
  IL_004c:  call       instance valuetype System.DateTime System.DateTime::AddTicks(int64)
  IL_0051:  ret
} // end of method DateTime::AddMilliseconds
Comment 2 tangjfn 2013-05-08 11:13:24 UTC
mscorlib.dll compiled use powerpc e300c3

.method public hidebysig instance valuetype System.DateTime 
        AddMilliseconds(float64 'value') cil managed
{
  // 代码大小       82 (0x52)
  .maxstack  2
  .locals init (int64 V_0)
  IL_0000:  ldarg.1
  IL_0001:  ldc.r8     3600000.
  IL_000a:  mul
  IL_000b:  ldc.r8     3600000.
  IL_0014:  bgt        IL_0032
  IL_0019:  ldarg.1
  IL_001a:  ldc.r8     3600000.
  IL_0023:  mul
  IL_0024:  ldc.r8     3600000.
  IL_002d:  bge.un     IL_0038
  IL_0032:  newobj     instance void System.ArgumentOutOfRangeException::.ctor()
  IL_0037:  throw
  IL_0038:  ldarg.1
  IL_0039:  ldc.r8     3600000.
  IL_0042:  mul
  IL_0043:  call       float64 System.Math::Round(float64)
  IL_0048:  conv.i8
  IL_0049:  stloc.0
  IL_004a:  ldarg.0
  IL_004b:  ldloc.0
  IL_004c:  call       instance valuetype System.DateTime System.DateTime::AddTicks(int64)
  IL_0051:  ret
} // end of method DateTime::AddMilliseconds
Comment 3 Ludovic Henry 2018-01-18 22:01:49 UTC
The difference in the IL seems suspicious between i386 and ppc. Could you please attach the 2 mscorlib binaries? Could you also please run with `MONO_VERBOSE_METHOD=System.DateTime.AddMilliseconds` environment variable set so it logs information on the JITting of the method? You could do this last step with both mscorlib binaries to figure out if the native code generated is different. Thank you.