Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

4.6 iOS 64-bit beta

Discussion in 'iOS and tvOS' started by jonas-echterhoff, Jan 12, 2015.

  1. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @ArticulatedPhysics

    Thanks for reporting this. There is no limit to the number of parameters, so this looks like a bug we need to fix from the IL2CPP side. Can you submit a bug report with a project that causes this issue? Thanks.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @00christian00

    Yes, we did profile this before enabling it. :) Thanks @Wiliz for the response.
     
  3. Skittlebrau

    Skittlebrau

    Joined:
    Jan 8, 2013
    Posts:
    34
    Thanks, we were on 5.0.1, but 5.0.1p4 does seem to fix it.
     
  4. dchau_hh

    dchau_hh

    Joined:
    Jan 22, 2014
    Posts:
    24
    @JoshPeterson

    Hi Josh,

    Did anyone look at issue 689976? We're still getting the deadlocks with 4.6.5 and the issue has been set to Closed with no comments.

    Thanks!
     
  5. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Thanks for your and the Unity team's hard work. I'm ok with these warnings as long as I know they're benign. I'm sure that soon everything will be back to normal. Thanks for putting my mind at ease about these warnings.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @dchau_hh

    Sorry that we did not communicate with you more effectively about this bug, we should have. We fixed a deadlock issue in 4.6.5p1, and it looks like this bug was resolved as part of that effort, since we can no longer reproduce the issue with the version that has the fix.

    Can you try again with 4.6.5p1? If the issue still occurs, please ping me here or send an email to the bug report. That action will open the bug report again.
     
  7. dchau_hh

    dchau_hh

    Joined:
    Jan 22, 2014
    Posts:
    24
    @JoshPeterson

    Just tried it with 4.6.5p1 and it locked up on my first 5 attempts before eventually settling in at an ~60% repro rate. Running the Release scheme in XCode seems to increase the likelihood of it occurring. I'll also email the bug report with this info.

    Thanks for the continued efforts!
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @dchau_hh

    Thanks for trying this with 4.6.5p1. Please let me know the bug report number, and I'll have a look at it.
     
  9. dchau_hh

    dchau_hh

    Joined:
    Jan 22, 2014
    Posts:
    24
    @JoshPeterson

    Bug 689976. Thanks Josh!
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
  11. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    Calling function via a delegate to an interface broken again. Last working version is 4.6.4p1.
    This bug catch in real game, but I can't reproduce them in small test project.

    EDIT: Yeah! I reproduce this! Simple wrap test in template class!
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. interface ITest1 {
    4.     void Test1();
    5. }
    6.  
    7. class TestClass<T> where T : ITest1 {
    8.     public string DoTest(T t) {
    9.         System.Action a = t.Test1;
    10.         return a.Method.Name;
    11.     }
    12. }
    13.  
    14. class Main : MonoBehaviour, ITest1 {
    15.     public void Test1() {}
    16.  
    17.     void Start() {
    18.         var c = new TestClass<Main>();
    19.         Debug.Log(c.DoTest(this));
    20.     }
    21. }
    22.  
     
    Last edited: May 13, 2015
  12. grifdrey

    grifdrey

    Joined:
    May 13, 2015
    Posts:
    11
    Hello, can you help me? im trying to build my game for IOS64 and build operation works fine. But when i run my game on device game crashed. Mono version works fine.
    Log:

    FormatException: Input string was not in the correct format

    at System.Type.GetTypeFromHandle (RuntimeTypeHandle handle) [0x00000] in <filename unknown>:0

    at System.Int32.TryParse (System.String s, Int32& result) [0x00000] in <filename unknown>:0

    at GlobalParser.ParseSingleValue (System.String source) [0x00000] in <filename unknown>:0

    at GlobalParser.ParseCondition (System.String source) [0x00000] in <filename unknown>:0

    at QuestsDataBase.Parse (System.String input) [0x00000] in <filename unknown>:0

    at QuestsDataBase.Initialize (Int32 campaignIndex) [0x00000] in <filename unknown>:0

    at DataBase..ctor (Int32 campaignIndex) [0x00000] in <filename unknown>:0

    at GameCore.Create (Int32 campaignIndex) [0x00000] in <filename unknown>:0

    at MenuLoader+<NewGame>c__Iterator83.MoveNext () [0x00000] in <filename unknown>:0

    at System.Array+InternalEnumerator`1[UnityEngine.Color].get_Current () [0x00000] in <filename unknown>:0


    (Filename: currently not available on il2cpp Line: 4294967295)
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @Ges

    Thanks for tracking this down. This is actually the same as an existing bug that we have just corrected. The fix should land in 5.0.2p2 and 4.6.5p3. In the mean time, I believe that you can work around the problem by wrapping the System.Action assignment in a lambda like this:

    Code (CSharp):
    1.  
    2. class TestClass<T> where T : ITest1 {
    3.     public string DoTest(T t) {
    4.         System.Action a = () => { t.Test1() };
    5.         return a.Method.Name;
    6.     }
    7. }
    8.  
    Obviously this will involve an additional function call, but it should work around the problem. The issue here is with the generic constraint on TestClass, actually. The IL2CPP conversion is not correctly understanding that this is a method call on the ITest1 interface.
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @grifdrey

    I've not seen a case like this before. Can you submit a bug report with a project that reproduces this issue? I am interested to know what the string passed to Int32.TryParse is. That might be enough for us to correct the problem.
     
  15. Ges

    Ges

    Joined:
    Apr 23, 2014
    Posts:
    31
    Sure I can. But since it occurs only at runtime, I'm afraid to miss something.
     
  16. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    With regards to size again. I noticed that the aot compiler generated method and type names in the .s files as m1... or t1.. and conversely in the il2cpp it generated a really long method name.

    A simple analysis of the resulting il2cpp binary file shows that the link segment and the text segment is almost the same size.. meaning, symbol names are just as big as my code size. Now that means that we also have many functions that do very little so much so our method names are bigger than the actual generated code.. :(

    Was wondering if there was a simple switch that can be turned on so that the il2cpp generated method names and types could be smaller or shortened..
     
  17. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    Apologies.. I just saw that there is a command line switch
    –output-format=Compact
    Where/how can I switch it on to test?
     
  18. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    Latest 4.6.5p1 il2cpp compilation is crashing with too many heap sections for our game. 4.6.4p4 compiles fine.
     
  19. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    I'm not using development build, it's definitely not there 4.6.4p4
    4.6.5p1 is crashing so I can't really tell unfortunately
     
  20. big_march

    big_march

    Joined:
    Mar 2, 2015
    Posts:
    38
    I got a crash caused by dynamic batch in Unity4.6.4p4. (GfxDevice :: DynamicBatchMesh crash)
    Now as I know, this crash only occurred on iPhone5S with iOS 7.0.1, the crashed ipa was built by IL2CPP, with dynamic batch turned on ( default setting ).

    Mono(2.x) build is fine.
    IL2CPP build but turned off dynamic batch in build-setting-panel is fine.

    I do believe this is a IL2CPP bug in Unity4.6.4p4, could you got anything useful from the log?
    Please check the attach. Thanks.
    @JoshPeterson
     

    Attached Files:

    Last edited: May 14, 2015
  21. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    4.6.5p1 crashes when building under windows. No problems on OSX.
     
  22. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    This one sounds like 64 bit skinning problem. We would need some repro project with scene you are using for testing to look into this issue. Thanks!
     
  23. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Are you investigating binary extracted from IPA file, which was exported from Xcode archive? If not you probably have symbols not stripped and it's not something you would see in App Store submission package.
     
  24. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    44
    Mantas. No, I was inspecting the .app that was produced from a released build. And yes, I just only figured out that symbols weren't stripped at all, during a normal release build with all optimizations switch on. I've managed to manually strip the symbols and it's much much better. I guess having -output-format=Compact doesn't have much impact on the code size with all symbols stripped out then.

    What about –enable-generic-sharing? I checked using process explorer and it doesn't seem like it was on the command line for il2cpp.exe. Is that automatically turned on? If not, can I switch it on? This was in reference to Josh's blog on il2cpp internals.
     
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @FrenzooInfo

    The --enable-generic-sharing option is now always on, it is no longer an option. So even if you don't see it on the comment line, you are are getting the generic sharing behavior, which I'll discuss in an upcoming blog post!
     
  26. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    Yes, we did benchmarks and saw no performance difference. We had turned it on previous (AFAIK) because the mono AOT compiler (non-thumb) did not always properly emit the proper instructions to transitions to thumb compiled C++.
     
    00christian00 likes this.
  27. MaydayWorks

    MaydayWorks

    Joined:
    Aug 18, 2014
    Posts:
    6
    We're using 4.6.5f1 for ARM64 IL2CPP building. We use System.Net.Sockets for non-blocking TCP connecting. Things work well in mono backend. But with IL2CPP backend, when socket.connect() called, an socket exception with native code 10036(InProgress) raised. We're sure this is the only socket we created.
    Code (CSharp):
    1.     private bool connect()
    2.     {
    3.         try
    4.         {
    5.             socket = new Socket(
    6.                 AddressFamily.InterNetwork,
    7.                 SocketType.Stream,
    8.                 ProtocolType.Tcp);
    9.            
    10.             socket.NoDelay      = true;
    11.             socket.Blocking     = false;
    12.            
    13.             socket.SendTimeout      = -1;
    14.             socket.ReceiveTimeout   = -1;
    15.            
    16.             socket.LingerState      = new LingerOption(true, 0);
    17.            
    18.             socket.Connect(ipEndPoint);
    19.         }
    20.         catch (Exception e)
    21.         {
    22.             SocketException socketException = e as SocketException;
    23.             if (null == socketException || SocketError.WouldBlock != (SocketError)socketException.ErrorCode)
    24.             {
    25.                 Debug.LogError(string.Format("BaseSocketTask Connect Exception: {0}", e.Message.ToString()));
    26.                
    27.                 return resultCallback(SL_LOCAL_NETWORK_CONNECT_FAIL);
    28.             }
    29.         }
    30.        
    31.         statusStartTick = Time.realtimeSinceStartup;
    32.        
    33.         return true;
    34.     }
    When socket.Blocking set to true, the connection is succeed and no exception raised. Non-Blocking is key to our game. Any advice?
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @MaydayWorks

    This sounds like a bug from the IL2CPP side. I've not seen one like this yet though, so is it possible for you to submit a bug report with an example project? That will giv eus the best chance to track it down. Thanks.
     
  29. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
  30. ___Petr___

    ___Petr___

    Joined:
    Jun 4, 2013
    Posts:
    40
    We see that when building il2cpp universal the Build Active Architecture Only settings is set to Yes for Debug scheme. Is this correct? As I understand, for Debug builds executable will only contain arch of connected device. Also, if I understand, memory consumption of debug build wil be different (smaller) than on release build. We easily can set this setting manually or in postprocess script to No. But maybe its correct to set this setting on Unity level when building il2cpp Universal?
    Sorry for my English:)
     
  31. Augality

    Augality

    Joined:
    Aug 4, 2014
    Posts:
    14
    Any progress on version 4.6.5p2?
     
    ___Petr___ likes this.
  32. emi-albu

    emi-albu

    Joined:
    Aug 15, 2012
    Posts:
    9
    Hi Josh. We also have a problem with the deadlocks. It also happens in 4.6.5p1.
    Here - a screenshot in xCode maybe it helps.
     

    Attached Files:

  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    Thanks for submitting this bug. After a quick look at the screen shot from the crash, I suspect that this is a bug we have already corrected in 4.6.5p2. That release should be out within the next day or so. Please give it a try. Thanks.
     
  34. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @Augality

    It was due out Friday of last week, but we've had a slight delay. I expect it to be ready in the next day or two.
     
  35. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @emkill2005

    Thanks for letting us know about this. I can't say for sure, but it does look like that is the same deadlock bug that we corrected in 4.6.5p2.

    I sound like a broken record here, sorry. Please try 4.6.5p2 when it is out. Thanks!
     
  36. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Any update on the iOS il2cpp binary size problem? Especially with Universal architecture. It's not unreasonable that universal architecture takes twice the size, it's just very hard (practically impossible) to stay below apple's 100mb limit.
    How much of our code goes into that one main binary and can we do anything to move it somewhere else?

    It was announced at 4.6.4p1 that you did improvements to the size, should we expect any additional reductions in the near future? With 4.6.5p1 we're still quite far above the limit. Moving the code to a dll or something would probably solve our immediate problem as that would allow it to be properly compressed.
     
  37. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @UnLogick

    We're continuing to work on binary size improvements. We have a few things in progress now, but nothing will be ready in the 4.6.5p2 release. The 4.6.5p1 release included compilation with thumb instructions, which helps the executable size on the armv7 slice (although not arm64). I would expect a few more weeks until we can land the next major binary size reduction, when we are able to move the type metadata out of the binary.

    Note that we have a nice write up about what we know about the Apple size requirements here:

    http://forum.unity3d.com/threads/il2cpp-build-size-improvements.322079/

    If you haven't seen that it might help. For iOS though, I don't believe you have the option to move the code out to a DLL, as everything needs to be in one binary. Build size is out highest priority now, so expect improvements in the future.
     
  38. Augality

    Augality

    Joined:
    Aug 4, 2014
    Posts:
    14
    Ok, thank you for the update. :)
     
  39. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Thanks, I had missed that thread, but while it was very illuminating it doesn't solve our problems. Glad to hear build size is still highest priority.
     
  40. Martin-S

    Martin-S

    Joined:
    Nov 19, 2012
    Posts:
    11
    Has anyone else found that having a script with OnCollisionEnter() without the Collision parameter crashes the app when the collision occurs with IL2CPP? I've submitted a bug report, number 697738.
     
  41. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    What version of Unity is that with? I seem to remember some fix about crashes when event parameters didn't match on some patch release.
     
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
  43. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,775
    @Martin S

    Thanks for submitting this bug, we will investigate it.
     
  44. Martin-S

    Martin-S

    Joined:
    Nov 19, 2012
    Posts:
    11
    5.0.2p1. I haven't tested with any other version.
     
  45. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @JoshPeterson 4.6.5p2 solved the bug we had, but I sent another different repro project because there is a compilation error which seems to be related with generics. It used to compile in 4.6.5p1.
     
  46. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Yay, some good fixes/improvements in there.

    Only you changed the stripping to be even more aggressive, my link.xml file is growing.

    Let's see it was a static readonly dictionary with a constructor initialiser calling a generic static method with arguments generated by an anonymous method. Good luck figuring that one out. :) (NodaTime library)

    Edit: Oups forgot to mention that the anonymous method returned an anonymous struct thingy. Want me to send you the entire static constructor code block, I'm sure that's enough to get the picture.
     
    Last edited: May 19, 2015
  47. Nub3h

    Nub3h

    Joined:
    Aug 23, 2012
    Posts:
    56
    Hi there, I'm using 4.6.5p1 and I upgraded an old project to use IL2CPP. Compilation works fine but I noticed that on old devices (iPad 3, iPad Mini 2nd generation) the app now takes 20-30 seconds to launch (was taking 15s before). The good news is that on iPhone 6 Plus the app launches in only 4 seconds (THAT'S FAST!). Is there a way to optimize old devices launch times or is it due to the IL2CPP compilation and can't be improved? Thanks for letting me know.
     
    MrEsquire likes this.
  48. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    Are you sure you are building in Release in Xcode when doing these timings? If not please let us know and file a bug. We do a bit of initialization at startup, and could use test cases to optimize this if you are really seeing these times in Release.
     
  49. Nub3h

    Nub3h

    Joined:
    Aug 23, 2012
    Posts:
    56
    If I change the Run scheme to release the app fails to launch for some reason. I usually never saw big changes in launch times between apps deployed on device through XCode and those deployed through HockeyApp of Testflight. Should I still file a bug report? As I mentioned on new device the app launches super quick. Thanks for letting me know.
     
  50. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147