Search Issue Tracker

Fixed in 4.5.X

Votes

6

Found in

4.3.1f1

Issue ID

580605

Regression

No

Generated AOT code is wrong when building for iOS on Windows

iOS

-

To reproduce:
1. Create a new project
2. Attach a script that debugs System.TimeSpan.MinValue.TotalSeconds or System.DateTime.Now.Ticks to the main camera
3. Build on Windows for iOS
4. Run Xcode project on Mac
5. Notice that Xcode debugger/console logs numbers like: 4.0917397079469E+142 which are different from the numbers logged when the project is run in the Editor.

Comments (7)

  1. vcadieux

    May 18, 2014 16:34

    I am getting this problem using the Unity Social.LoadScores, if I compile under Windows I'll get this error and if I compile on MacOSX I am not getting this error. So this might be related to the same bug.

  2. sindrijo

    Apr 23, 2014 11:02

    I have the same problem on iOS with Unity 4.3.3f1

    System.ArgumentOutOfRangeException: Argument is out of range.
    at System.DateTime.AddTicks (Int64 value) [0x00000] in <filename unknown>:0
    at System.DateTime.AddMilliseconds (Double value) [0x00000] in <filename unknown>:0
    at System.DateTime.AddSeconds (Double value) [0x00000] in <filename unknown>:0
    at System.DateTime._DoParse (System.String s, System.String firstPart, System.String secondPart, Boolean exact, System.DateTime& result, System.DateTimeOffset& dto, System.Globalization.DateTimeFormatInfo dfi, DateTimeStyles style, Boolean firstPartIsDate, System.Boolean& incompleteFormat, System.Boolean& longYear) [0x00000] in <filename unknown>:0
    at System.DateTime.ParseExact (System.String s, System.String[] formats, System.Globalization.DateTimeFormatInfo dfi, DateTimeStyles style, System.DateTime& ret, Boolean exact, System.Boolean& longYear, Boolean setExceptionOnError, System.Exception& exception) [0x00000] in <filename unknown>:0
    at System.DateTime.ParseExact (System.String s, System.String[] formats, IFormatProvider provider, DateTimeStyles style) [0x00000] in <filename unknown>:0
    at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider, DateTimeStyles style) [0x00000] in <filename unknown>:0
    at System.DateTime.ParseExact (System.String s, System.String format, IFormatProvider provider) [0x00000] in <filename unknown>:0

  3. KevinCodes4Food

    Mar 14, 2014 22:43

    I'm still encountering this on 4.3.41f. I see no notes in the 4.3.4 release notes about this being fixed.

    It is marked as "fixed" but what version of Unity is the fix in?

  4. Smilediver

    Feb 17, 2014 11:41

    This is caused by general AOT issues, and are not related to DateTime itself. To be more precise: wrong double and 64 bit int alignments, compiler optimization issues which makes AOT code to invoke wrong methods, etc. Fixes are targeted for the next Unity 4.x release.

  5. liortal

    Feb 13, 2014 17:12

    it says that the bug is fixed, but there's no target version here. Is this information available in the issue tracker system in this site?

  6. Aloex666

    Jan 21, 2014 15:57

    Seems to be a general issue, that the .AddXXXX-Functions doesn't work and it seems that this issue exists since a few Versions :/

  7. chiepomme

    Jan 10, 2014 09:40

    Maybe because of this probrem, a calculation on DateTime objects fails.
    I've tried to run following code on iOS with Unity 4.3.1f1,
    which have thrown ArgumentOutOfRangeException.
    -----------------------------------------------
    DateTime.Now.AddMinutes(0.3);
    -----------------------------------------------
    ArgumentOutOfRangeException: Argument is out of range.
    at System.DateTime.AddTicks (Int64 value)
    at System.DateTime.AddMilliseconds (Double value)
    at System.DateTime.AddSeconds (Double value)
    at ...
    -----------------------------------------------
    This code works fine on my Windows.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.