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. tomtc123

    tomtc123

    Joined:
    Aug 22, 2014
    Posts:
    11
    Someone help me.please
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)

    Source : Message :System.NotSupportedException: http://my.php
    at System.Net.Sockets.Socket.get_SocketType () [0x00000] in <filename unknown>:0
    at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0
    at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0
    at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in <filename unknown>:0
    at FileDownloader.Request (System.String url, Int32 begin, Int32 end, .OnResponseRead readCallback, .OnDownloadComplete completeCallback, System.Object info) [0x00000] in <filename unknown>:0
    at DownFileManager.DownloadResourceAddress () [0x00000] in <filename unknown>:0
    at DownFileManager.Start () [0x00000] in <filename unknown>:0
    at Replacements.Attribute.CheckParameters (System.Object element, System.Type attributeType) [0x00000] in <filename unknown>:0
    Replacements.Attribute:CheckParameters(Object, Type)
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    UnityEngine.Debug:LogError(Object)
    FileDownloader:Request(String, Int32, Int32, OnResponseRead, OnDownloadComplete, Object)
    DownFileManager:DownloadResourceAddress()
    DownFileManager:Start()
    Replacements.Attribute:CheckParameters(Object, Type)
     
  2. drawcode

    drawcode

    Joined:
    Jul 21, 2008
    Posts:
    70
    WebRequest is not yet ported to IL2CPP, I think it is planned soon. You could port to the WWW class until then maybe.

    Also the http://my.php url looks wrong unless that is a munged. http://my.php.net is valid but http://my.php would error.
     
  3. tomtc123

    tomtc123

    Joined:
    Aug 22, 2014
    Posts:
    11
    Thank you for your reply soon, Forget the url , it's not the right address ;),
     
  4. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    @Lucas Meijer and your team----
    I'm very happy that you got my project--stripped down project--running on il2cpp and thank you for that--but I have a problem still. My project is a 3d rpg game and they tend to be rather large--to give you an idea with all the assets it's using-the project file size is 5.0 gb--(thanks to the Unity Asset store--using Unity Pro so some unused assets are stripped I believe. : ). So when I tried to run my game on my 32 bit device--an ipad mini---I couldn't get it to run.

    You can run an app using il2cpp as the backend on a 32 bit device as well as a 64 bit device is that right? I think Apple requires you to build for both.

    I'm trying to make smaller levels so the game is not so large. I can't really upload a bug file to you because it would mean uploading a very big file, not a stripped down file.

    So my question is---shouldn't I be able to run my game on my 32 bit device using il2cpp and do you have any recommendations on how I can do that?

    I think the first thing I have to do is make it smaller. In the process of doing that.

    Or cannot il2cpp as the back end build an app that runs on a 32 bit device as well as a 64 bit device? I feel sure it can.

    I've temporarily gone back to 6.2 without any patches and using mono as the backend and my new pared down file runs on my 32 bit ipad mini with no problem--at least so far. I basically rebuilt a lot of levels to be smaller with fewer assets. My project size is 5.0 gb but everything runs smoothly with mono as the backend--working on making it even smaller. I don't have the courage to try il2cpp as the back end yet because the last time I couldn't run my game on my 32 bit device. Maybe after I get the game rebuilt with the smaller levels.

    Thanks for your kind assistance and your past help. I have testers who can test on a 64 bit device--and I can bite the bullet and buy a 64 bit device even though I love my 32 bit Minnie---but I thought this should run on my 32 bit Minnie with no problem using il2cpp as the backend.
     
    Last edited: Feb 8, 2015
  5. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    368
    I'm getting a crash and at least one of the reasons seems to be leaderBoard.LoadScores, has anybody successful loaded game center leaderboards?

    Code (CSharp):
    1.         Action<bool> scoresLoaded= (didLoad) => { Debug.Log("LoadScores result: "+didLoad); };
    2.  
    3.         leaderBoard.LoadScores(scoresLoaded);
    It falls over when it reaches the end of the table(I can see the scores loading) xcode prompts EXC_BAD_ACCESS
     
  6. obooth

    obooth

    Joined:
    Feb 4, 2015
    Posts:
    1
    Getting this with 4.6.2f1 when running on the device - any ideas?
     
  7. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    368
    That seems to be the exact same issue I'm having, in my Xcode I see this:

    So it seems like authentication is ok, it will load all the high scores reported to the leaderboard..I get about 11 which should be right as I just created some sandbox users to test with, and when it finishes loading all existing scores on the leaderboard..it will crash.

    Screen Shot 2015-02-08 at 19.04.10.png

    I can still run the 64bit build on the device by enabling flight mode so it can't connect to game center.

    I have submitted a bug for this now with an example project: Case 670862
     
    Last edited: Feb 9, 2015
  8. cojo71

    cojo71

    Joined:
    Aug 19, 2014
    Posts:
    26
    @Lucas Meijer / @joncham - was anyone able to determine a) if there is a workaround for this issue (case #670080) and / or b) if a fix will be available for this week's patch release?
    Our company is effectively losing significant revenue at this point as we are unable to release multiple new iOS apps on our normal cadence for this month since they are dependent on these backend integrations.

    Thanks!
     
  9. mcarriere

    mcarriere

    Joined:
    Sep 14, 2012
    Posts:
    106
  10. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Thanks. Both Unity 4.6 and Unity 5 works using the new command. I can automate the build process.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,533
    Are there any issues with generic dictionaries? I just submitted a case (670799) with a stripped down project that's slightly more complicated than just a generic dictionary lookup, but I think that's where the problem lies.
     
  12. bberryEA

    bberryEA

    Joined:
    Jan 13, 2015
    Posts:
    3
    Similar outcome here with 4.6.2p1, different method signature.
    Case 670873.

    stdout;

    IL2CPP error for method 'System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Channels.ChannelServices::CreateClientChannelSinkChain(System.String,System.Object,System.String&)' in assembly '/Users/bberry/WS/client/Temp/StagingArea/Data/Managed/mscorlib.dll'

    Additional information: Build a development build for more information. Invalid global variables count

    Parameter name: globalVariables

    stderr:



    Unhandled Exception: System.ArgumentException: Invalid global variables count

    Parameter name: globalVariables

    at Unity.IL2CPP.MethodBodyWriter.WriteAssignGlobalVariables (Unity.IL2CPP.StackAnalysis.GlobalVariable[] globalVariables) [0x00000] in <filename unknown>:0

    . . .
     
    Last edited: Feb 9, 2015
  13. FredRodrigue

    FredRodrigue

    Joined:
    May 24, 2013
    Posts:
    6
    Hi,

    We have a bug with the plugin Behavior Designer when we use SharedVariables.

    Here's the error
    Code (CSharp):
    1. TypeLoadException: A type load exception has occurred.
    2.   at <Module>.UnsupportedMember_Type (System.Reflection.Emit.TypeBuilder self, System.String signature) [0x00000] in <filename unknown>:0
    3.   at System.Type.MakeGenericType (System.Type[] typeArguments)
    Here's the bug report number: 670875.

    Thanks
     
  14. JJC1138

    JJC1138

    Joined:
    Feb 23, 2012
    Posts:
    89
    I mentioned the other day a bug with sending RPCs with array parameters, which was not IL2CPP-specific. It turns out that there's another RPC bug which is IL2CPP-specific, which is that IL2CPP builds can't receive any RPCs (sending them, and using NetworkView synchronization seem to work fine, though). They don't crash, but the RPC isn't delivered to the script and an error is shown on the Xcode console:
    I've filed a bug with a minimal test project as case number 670887.
     
  15. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @catacomber: il2cpp should work just as well on 32 bit as on 64bit. If you have a piece of code that producs different results on 32bit as on 64bit, we would love to take a look at it.

    @JJC1138: sorry for not having gotten you many replies yet. many thanks for the bugreports, we'll try to get to them, they're not forgotten.

    @FredRodrigue: we currently do not support Type.MakeGenericType (except in some circumstances where we can statically predict which types will be made). @joncham has been doing a lot of work in the last months on "runtime metadata creation", which will make Type.MakeGenericType work. In the meantime, if you know in advance which types Type.MakeGenericType will want to make, you can create a static field somewhere in your code of that type, which will make il2cpp know you'll want to have that type, and that might get you past this problem for now, withoout having to wait on a new build

    @bberryEA: thanks for the report. looks like a legit bug. we'll take a look.

    @TonyLi: generic dictionaries should work just fine. we'll take a look at your bugreport to see what's going on

    @cojo71: the parse issue is high very high on our radar. I do not have an eta for you right now, but I'll update here in this thread when we do.

    @sfjohansson: I think we fixed this bug this week, and that there's a workaround you can do without having the new build. I'll ask @lukaszunity if he can send you the workaround.

    @Hacky: I would love to fix that, could you send a bugreport with a reproproject that shows the problem, so we can fix it? thanks!
     
    cojo71, TonyLi and JJC1138 like this.
  16. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    454
    @Lucas Meijer, could confirm this bug has been noticed? It's blocking IL2CPP support on my product at the moment.
     
  17. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @imck: thanks, I will take a look
    @Simie: thanks, we'll take a look
    @rairaia: looks like we missed a spot there, we'll fix it.
    @brianchasalow: WebRequest is #1 on our list. we've been working on it for quite some time. I cannot promise it will be in the next patch release, but I can say that as soon as it is ready to ship, we will do another patch release straight away.
     
  18. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    454
    Awesome, thanks.
     
  19. GuillaumeZAHRA

    GuillaumeZAHRA

    Joined:
    Jan 5, 2013
    Posts:
    53
    Hi, i have 2 questions:

    1. Any news on my case (670422) ? It concern the ExternalCall method for some dll dependencies.
    2. I don't know if it's the good thread to talk about it, and i don't have found any information on this at the moment, but how long will you support Unity 4.x concerning IL2CPP for iOS when Unity 5 will come out ?

    I'm asking because i can actually manage to compile my project for Android/iOS and for Flash. My fear is that it would be some required patchs for a full working IL2CPP (for iOS) and that it would only be available on Unity 5.0.

    I want to be able to ship my game on iOS, but i can't drop the support for the Flash version. I fear that Unity 5 project format would just say "no" if i try to re-open it in Unity 4.6.1 (the last version that support Flash).

    Sorry for the long post, i didn't have found any topic about the roadmap for IL2CPP on 4.6.

    Thanks in advance !
     
  20. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
     
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    For a change of pace: I updated an old game with the Unity 4.6 IL2CPP beta, and switched to 4.6.2 before publishing it. It was approved today...sorry for not submitting any bug reports, but that's because stuff apparently insisted on just working. I wasn't using any third-party plugins though, and the game isn't really pushing any boundaries. (The hardest thing about the process was getting iTunes Connect to work—my uploads kept vanishing into limbo.) The worst I can say is that the binary size seems excessively large, even taking into account universal binaries, but that's a known issue and is being worked on.

    --Eric
     
  22. answerwinner

    answerwinner

    Joined:
    Jan 8, 2015
    Posts:
    47
    I'm using Unity 4.6.2f1, running my game on iPad Air, this error occured after launch:

    Code (CSharp):
    1. NotSupportedException: Cannot marshal type 'JSApi/jsval'.
    2.   at AssetBundleLoader+OnLoadAssetBundle.Invoke (UnityEngine.AssetBundle ab) [0x00000] in <filename unknown>:0
    3.   at JSApi.JSh_GC (IntPtr rt) [0x00000] in <filename unknown>:0
    4.   at JSMgr.ExecuteScript (IntPtr ptrScript, IntPtr obj) [0x00000] in <filename unknown>:0
    5.   at JSMgr.OnLoadGeneratedJS (System.String shortName, System.Byte[] bytes, System.String fullName) [0x00000] in <filename unknown>:0
    6.   at JSFileLoader+OnLoadJS.Invoke (System.String shortName, System.Byte[] bytes, System.String fullName) [0x00000] in <filename unknown>:0
    7.   at JSValueWrap.WrapDouble (IntPtr cx, UInt32 argc, IntPtr vp) [0x00000] in <filename unknown>:0
    8.   at JSFileLoader.LoadJSSync (System.String shortName, Boolean bGenerated, .OnLoadJS onLoadJS) [0x00000] in <filename unknown>:0
    9.   at JSMgr.InitJSEngine (.JSFileLoader jsLoader, .OnInitJSEngine onInitJSEngine) [0x00000] in <filename unknown>:0
    10.   at JSEngine.Awake () [0x00000] in <filename unknown>:0
    11.   at UnityEngine.PlayerPrefs.DeleteKey (System.String key) [0x00000] in <filename unknown>:0
    12. UnityEngine.PlayerPrefs:DeleteKey(String)
    13. (Filename: currently not available on il2cpp Line: 4294967295)

    ------------------------------------------------------------------------------------------------------------------------------------


    Code (CSharp):
    1. [StructLayout(LayoutKind.Explicit)]
    2. public struct jsval
    3. {
    4.     [FieldOffset(0)]
    5.     public UInt64 asBits;
    6. }
    7.  
    8. [DllImport(JSDll, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
    9. public static extern bool JSh_ExecuteScript(IntPtr cx, IntPtr obj, IntPtr script, ref jsval rval);
    10.  
    11.  

    The struct jsval cann't be mashaled.
    Is there a solution?
     
    Last edited: Feb 10, 2015
  23. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    No news to 64 bit iOS IL2CPP in 4.6.2p1 huh? I'm installing it anyways, FWIW...
     
  24. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    RealMaze 3d? Just bought it. :) If that's it, will wait for the update and see how it runs on my Minnie. :) Looks like my kind of fun.

    Our rpg game was fairly large and I think that may be the problem. Making the terrains smaller but still beautiful and taking out some things where I can reuse others. Have reduced the project so far by a gigabyte and trying to get it down one more. It's actually a good exercise in trying to think through what's important.
     
  25. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yep.

    Thanks! :)

    The update's out now, since Apple approved it today. (Version 2.0.)

    My project is only 300MB, which is mostly large Photoshop files. The estimated size of the .ipa in XCode was 70MB, though it's actually about 50MB on the store.

    --Eric
     
  26. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    @answerwinner:

    We currently don't support LayoutKind.Explicit for marshaling. This issue is known, but it seems in your case it would be easy to work around it - just remove StructLayout and FieldOffset attributes, as they have no effect - they match default marshaling rules.
     
  27. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    The update is running fine on my Minnie with a very, very slight delay at the beginning--when I tap on the big gold arrows. My project has a lot of particle effects and music and sound effects and a game editor plugin and a random dungeon editor and monsters and full of all the things I couldn't resist from the asset store and is still,4.8 gigabytes down from 6.0. Working hard to tighten it up. I know Unity Pro can strip unused textures but I used a lot.

    Congrats on getting your update uploaded--and accepted. :) And thanks that it brightens my day.

    EDIT: What was the setup of your Architectures in XCode? Thanks.
     
    Last edited: Feb 10, 2015
  28. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    We have a crash when we try to do an "Enum.Parse":

    Code (CSharp):
    1. public enum Mode {
    2.         Data = 0,
    3.         Resources = 1,
    4.         StreamingAssets = 2
    5.     }
    6.  
    7. private string loadMode = "Resources";
    8.  
    9. public Mode LoadMode {
    10.         get { return (Mode)Enum.Parse(typeof(Mode), loadMode); }
    11.     }
    12.  
    13. void Awake() {
    14.   Debug.Log(LoadMode);
    15. }
    Stacktrace:

     
    Last edited: Feb 10, 2015
  29. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @bdominguezvw: hey, that snippet does not compile for me. if you could file a bugreport with a project that shows the prooblem, we'll fix it. thnx, L
     
  30. Hacky

    Hacky

    Joined:
    Mar 22, 2013
    Posts:
    28
    @Lucas Meijer: I reported this bug with an example project. But I didn't receive a confirmation mail. Should I resend this issue?

    Best regards,
    David
     
  31. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    @Lucas Meijer: It should compile now. I changed an hour ago the mistake was "loadMode" wasn't a string.

    I've tried now in Visual Studio and it compiles. It's an example and it should crash always with "Enum.Parse" because i've tried in other contexts with other code.
     
  32. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @bberryEA: hey, there is no repro project attached to 670873. can you reproduce this issue? if so, can you send us the project that reproduces it? thnx, L
     
  33. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @bdominguezvw: that code runs fine for me. can you please which you are on the latest version, and if you are, share the actual project instead of a snippet, as there is obviously something going on that is not caught by this snippet.
     
  34. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @Simie: I found and fixed your bug. I've sent you an email offlist with a short term workaround so you can continue while we work on getting a new build out.
     
    Simie likes this.
  35. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    @Lucas Meijer: I've tested on 4.6.2p1 (latest version). Tomorrow I'm going to check on my end on an empty project if it happens too.

    It's weird because there are two different projects on my team that crash so I don't think that it's something in this specific project.
     
  36. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Screen Shot 2015-02-10 at 12.37.43 PM.png

    --Eric
     
  37. Ly

    Ly

    Joined:
    Aug 5, 2013
    Posts:
    7
    Hi,

    Just to let you know, if someone is experiencing the same issues, I made 3 bug reports (with attached project) about il2cpp (using 4.6.2p1) :

    - constructor attributes cannot be retrieved using Reflection
    - attributes on method parameters cannot be retrieved
    - Enum.IsDefined() throw an error when using value of the underlying type (MonoEnumInfo.GetInfo() returns a null underlying type for the enum, so the Enum.IsDefined() method cannot work properly)

    I'm working on a big project with dependency injection (and named injection) and data deserialization, so those issues are criticals for my project, I'm stuck at the project initialization. Hoping for fixes soon.

    Florian.
     
  38. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
  39. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    Hi,
    I've reported bug 670140 and i found that error was my fault, is there a way to remove that report so it doesn't bother unity people?
     
  40. JJC1138

    JJC1138

    Joined:
    Feb 23, 2012
    Posts:
    89
    @malyna If you reply to the email you got with the case number in the subject then the contents of your email gets added the bug report, so you can just let them know that they don't need to investigate it. :)
     
  41. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @imkc: whoa, this case really surprises me. there is indeed an issue when using BinaryFormatter and Dictionary<string,string> I am zoning on a fix, but I fear that to support the code as it is, you need a new build. In the meantime the workaround I can imagine is temporarily converting it to a List<KeyValuePair<string,string>> which should survive the serializer roundtrip. I'll let you know through the bugreport when I have nailed the bug and when we'll ship it in a patch release.
     
  42. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @rairala: a fix for your issue was committed by @joncham today. no eta yet on the next patch release, but when it ships it will have the fix.
     
  43. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    Big Thx. Looks like i have to start reading emails :)
     
  44. answerwinner

    answerwinner

    Joined:
    Jan 8, 2015
    Posts:
    47
    I have a crash, please help. (Unity 4.6.2f1, il2cpp, iOS)

    Code (CSharp):
    1. ////////////// C ///////////////  this is Mozilla SpiderMonkey engine code
    2. // C function, return a pointer to C#
    3. JSScript* JSh_CompileScript(JSContext *cx, JSObject* global, const char *ascii, size_t length, const char* filename, size_t lineno)
    4. // C function, taken a JSScript** from C# (2nd param), to prevent rp from being collected
    5. bool JSh_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);
    6. // Garbage Collection
    7. void JSh_GC();
    Code (CSharp):
    1. ///////// C# /////////////
    2. class IntPtrClass
    3. {
    4.   public IntPtrClass(IntPtr p) { this.ptr = p; }
    5.   public IntPtr ptr;
    6. }
    7. static Dictionary<string, IntPtrClass> compiledScript = new Dictionary<string, IntPtrClass>();
    Code (CSharp):
    1. IntPtr obj = JSh_CompileScript(); // 1) get JSScript* from C
    2. var IntPtrClass pc = new IntPtrClass(obj);  // 2) new a class to store the JSScript*
    3. JSh_AddNamedScriptRoot(..., ref pc.ptr); // 3)  pass JSScript** to C, to prevent obj being GCed
    4. compiledScript.add("scriptName", pc); // 4)  store the class object
    5. JSh_GC(); // 5) calling C GC function, crashed here!   ***
    It seems it crashed trying to visit JSScript** passed from C#.
    It works with mono. crashed with il2cpp on iOS(32 and 64 all crashed).
    BTW, is this the correct way to store pointer's address?
     
    Last edited: Feb 11, 2015
  45. Tyhja

    Tyhja

    Joined:
    Jun 21, 2013
    Posts:
    19
    Hi Ly,
    I am also experiencing the same issues. Could you share your example project with me too?

    Please fix this!
     
  46. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    There was mention that MakeGenericType wasn't supported... Is it something that's planned for the near future? Judging by the suggestion to define the type on a static member I'm assuming this has something to do with the AOT implementation of the compiler... I'm only curious because my JSON .NET asset uses it and it's necessary to reconstruct generics via reflection. It causes some types such as LinkedList<T> and most likely any generic (SomeClass<T>) class to deserialize properly under IL2CPP.
     
  47. Hacky

    Hacky

    Joined:
    Mar 22, 2013
    Posts:
    28
  48. rjeon

    rjeon

    Joined:
    Feb 11, 2015
    Posts:
    6
    Build with IL2CPP crashes for Unity 4.6.2.p1.

    I think this is an IL2CPP/iOS bug because build with Mono backend option works without crash.

    Android build does not have this issue.

    It seems crash does not relate with architectures, because crash occurs both of architectures armv7 and armv64,
    as well as any device of iOS, such as iPhone5 and iPad Air.

    There is no source level stacktrace because XCode shows no more clue than assembly level.
    ( I have tried to build with Development build with script debugging option )

    This a stacktrace on XCode.

    Code (CSharp):
    1. iosqa`il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) at Liveness.cpp:300:
    2. 0x241e3d4:  push   {r4, r5, r6, r7, lr}
    3. 0x241e3d8:  add    r7, sp, #0xc
    4. 0x241e3dc:  sub    sp, sp, #0x4
    5. 0x241e3e0:  mov    r5, r0
    6. 0x241e3e4:  mov    r4, r1
    7. 0x241e3e8:  str    r5, [sp]
    8. 0x241e3ec:  cmp    r5, #0x0
    9. 0x241e3f0:  beq    0x241e4fc                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 296 at Liveness.cpp:321
    10. 0x241e3f4:  ldr    r0, [r5]
    11. 0x241e3f8:  tst    r0, #0x1
    12. 0x241e3fc:  bne    0x241e4fc                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 296 at Liveness.cpp:321
    13. 0x241e400:  bfc    r0, #0, #1
    14. 0x241e404:  ldrb   r6, [r0, #147]
    15. 0x241e408:  cmp    r6, #0x0
    16. 0x241e40c:  bne    0x241e428                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 84 at Liveness.cpp:309
    17. 0x241e410:  ldr    r1, [r4, #8]
    18. 0x241e414:  cmp    r1, #0x0
    19. 0x241e418:  beq    0x241e428                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 84 at Liveness.cpp:309
    20. 0x241e41c:  bl     0x24156d4                 ; il2cpp::vm::Class::HasParent(TypeInfo const*, TypeInfo const*) at Class.cpp:418
    21. 0x241e420:  cmp    r0, #0x1
    22. 0x241e424:  bne    0x241e490                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 188 at Liveness.cpp:315
    23. 0x241e428:  ldr    r1, [r4, #4]
    24. 0x241e42c:  ldr    r0, [r1, #4]
    25. 0x241e430:  ldr    r3, [r1, #8]
    26. 0x241e434:  cmp    r0, r3
    27. 0x241e438:  bne    0x241e450                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 124 [inlined] std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::push_back(Il2CppObject* const&) + 8 at Liveness.cpp:311
    28. il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 116 at Liveness.cpp:311
    29. 0x241e43c:  mov    r0, r4
    30. 0x241e440:  bl     0x241e504                 ; il2cpp::vm::LivenessState::SafeGrowArray(std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >*) at Liveness.cpp
    31. 0x241e444:  ldr    r1, [r4, #4]
    32. 0x241e448:  ldr    r0, [r1, #4]
    33. 0x241e44c:  ldr    r3, [r1, #8]
    34. 0x241e450:  cmp    r0, r3
    35. 0x241e454:  beq    0x241e474                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 160 [inlined] std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::push_back(Il2CppObject* const&) + 44 at Liveness.cpp:311
    36. il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 116 at Liveness.cpp:311
    37. 0x241e458:  cmp    r0, #0x0
    38. 0x241e45c:  mov    r2, #0x0
    39. 0x241e460:  strne  r5, [r0]
    40. 0x241e464:  ldrne  r2, [r1, #4]
    41. 0x241e468:  add    r0, r2, #0x4
    42. 0x241e46c:  str    r0, [r1, #4]
    43. 0x241e470:  b      0x241e484                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 176 at Liveness.cpp:312
    44. 0x241e474:  mov    r0, r1
    45. 0x241e478:  mov    r2, sp
    46. 0x241e47c:  mov    r1, r3
    47. 0x241e480:  bl     0x241eb2c                 ; std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Il2CppObject**, std::vector<Il2CppObject*, std::allocator<Il2CppObject*> > >, Il2CppObject* const&) at vector.tcc
    48. 0x241e484:  ldr    r0, [r5]
    49. 0x241e488:  orr    r0, r0, #0x1
    50. 0x241e48c:  str    r0, [r5]
    51. 0x241e490:  cmp    r6, #0x0
    52. 0x241e494:  beq    0x241e4fc                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 296 at Liveness.cpp:321
    53. 0x241e498:  ldr    r1, [r4, #12]
    54. 0x241e49c:  ldr    r0, [r1, #4]
    55. 0x241e4a0:  ldr    r3, [r1, #8]
    56. 0x241e4a4:  cmp    r0, r3
    57. 0x241e4a8:  bne    0x241e4c0                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 236 [inlined] std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::push_back(Il2CppObject* const&) + 8 at Liveness.cpp:319
    58. il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 228 at Liveness.cpp:319
    59. 0x241e4ac:  mov    r0, r4
    60. 0x241e4b0:  bl     0x241e504                 ; il2cpp::vm::LivenessState::SafeGrowArray(std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >*) at Liveness.cpp
    61. 0x241e4b4:  ldr    r1, [r4, #12]
    62. 0x241e4b8:  ldr    r0, [r1, #4]
    63. 0x241e4bc:  ldr    r3, [r1, #8]
    64. 0x241e4c0:  cmp    r0, r3
    65. 0x241e4c4:  beq    0x241e4ec                 ; il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 280 [inlined] std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::push_back(Il2CppObject* const&) at Liveness.cpp:319
    66. il2cpp::vm::LivenessState::AddProcessObject(Il2CppObject*, il2cpp::vm::LivenessState*) + 280 at Liveness.cpp:319
    67. 0x241e4c8:  mov    r2, #0x0
    68. 0x241e4cc:  cmp    r0, #0x0
    69. 0x241e4d0:  ldrne  r2, [sp]
    70. 0x241e4d4:  strne  r2, [r0]
    71. 0x241e4d8:  ldrne  r2, [r1, #4]
    72. 0x241e4dc:  add    r0, r2, #0x4
    73. 0x241e4e0:  str    r0, [r1, #4]
    74. 0x241e4e4:  sub    sp, r7, #0xc
    75. 0x241e4e8:  pop    {r4, r5, r6, r7, pc}
    76. 0x241e4ec:  mov    r0, r1
    77. 0x241e4f0:  mov    r2, sp
    78. 0x241e4f4:  mov    r1, r3
    79. 0x241e4f8:  bl     0x241eb2c                 ; std::vector<Il2CppObject*, std::allocator<Il2CppObject*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Il2CppObject**, std::vector<Il2CppObject*, std::allocator<Il2CppObject*> > >, Il2CppObject* const&) at vector.tcc
    80. 0x241e4fc:  sub    sp, r7, #0xc
    81. 0x241e500:  pop    {r4, r5, r6, r7, pc}
    82.  
     

    Attached Files:

    Last edited: Feb 11, 2015
  49. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @rjeon: do you have a project folder that reproduces that? we would really really like to take a look at that. could you be so kind to file a bug and attach it, and lets us know the bugnumber here? thanks!

    @Dustin Horne: the story with MakeGenericType() is that today it only works if IL2CPP actually alraedy knows about the type you're about to make. maybe through a static field of that type. @joncham has been hard at work the last few weeks to lift this limitation, and make MakeGenericType() work in other cases too.

    @answerwinner: the fastest way to get your problem fixed is to file a bugreport with the project attached so we can investigate. it's very hard to see what's going on from only the snippet.

    @Ly: thanks a lot! we will fix all of them.
     
    rjeon likes this.
  50. Lars-Blaabjerg

    Lars-Blaabjerg

    Joined:
    Apr 5, 2011
    Posts:
    54
    With IL2CPP, Enum.IsDefined throws an ArgumentException when used with an integer argument.

    This was reported by Ly above, but I already reported the bug and just wanted to add my case number: 669873

    Cheers