Search Unity

Firefox:too much recursion

Discussion in 'Web' started by mshiro0408, May 20, 2015.

  1. mshiro0408

    mshiro0408

    Joined:
    May 8, 2015
    Posts:
    5
    I trying porting my App from WebPlayer to WebGL.
    WebGL App works fine in Chrome, but in Firefox I get the error:

    I using Unity5.1.0f1.

    692 line of the output javascript code is the following code

    curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    The stack trace shows a call to CreateDirectory, which is not allowed In WebGL.

    This is probably called indirectly , for example by accessing Application.temporaryCachePath or a similar API.
     
  3. mshiro0408

    mshiro0408

    Joined:
    May 8, 2015
    Posts:
    5
    @liortal
    Thanks

    My App dose not use CreateDirectory and Application path API.
    This problem is Firefox Only.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I recall seeing the same issue for our game. In our case, it happened due to a call to some API that attempts to create a folder (we did not call it directly).

    Is the stack you posted the full one? or is there more? Also, could you send the javascript console output?
     
  5. mshiro0408

    mshiro0408

    Joined:
    May 8, 2015
    Posts:
    5
    I fixed this issue. My App using PlayerPrefs and ZDatabase asset.
    I have removed all of the writing and the reading of the code of PlayerPrefs, error was not out .
     
  6. DudeGuy

    DudeGuy

    Joined:
    Jul 17, 2014
    Posts:
    19
    I'm having this same problem with LoadFromCacheOrDownload for my asset bundles. It works like a charm in Chrome, but I get this same error every time I try to yield return www in Firefox (Mac & Windows). I'm unable to reproduce the situation outside of my main application so I don't know if it is directly related to that call. In my main application, it's nested inside a few different coroutines. I can run the app fine in Firefox without asset bundles.

    I use PlayerPrefs in all 3 browsers without problems so it doesn't seem to be related to that for me.

    I still need to investigate further.
     
  7. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Yep, totally forgot about that :) So PlayerPrefs is another API that uses files under the hood :)
     
  8. DudeGuy

    DudeGuy

    Joined:
    Jul 17, 2014
    Posts:
    19
    So are you saying that we're not allowed to use PlayerPrefs? As I mentioned, I use it very often for different things and it works great in Chrome. So is it only disallowed in Firefox?
     
  9. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Sorry my bad... actually PlayerPrefs should be supported. Sorry for the confusion :(
     
  10. DudeGuy

    DudeGuy

    Joined:
    Jul 17, 2014
    Posts:
    19
    No worries at all, I just wanted to make sure. What you mentioned about FileIO does possibly seem to relate to my issue, but I'm unsure still. I can call LoadFromCacheOrDownload in a new bare-bones project on the same asset bundle that fails in my main application. Perhaps using this method is doing some sort of FileIO that's causing issues only in certain situations? It seems to download the entire thing as it gets to 99% complete, but then I'm guessing it's the loading from cache that fails immediately afterwards.
     
  11. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Even FileIO should be supported I believe. I think this is a bug with asm.js in Firefox (probably not actually a Unity bug). The File IO stuff I think is wrapped and uses localStorage under the hood.
     
  12. DudeGuy

    DudeGuy

    Joined:
    Jul 17, 2014
    Posts:
    19
    Ouch, seems like this bug has existed for awhile based off of other various reports I've seen floating around. Hopefully it's fixed at some point as I don't know how to proceed on Firefox at this point. Thanks for the input.
     
  13. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Yeah, I think it's been an off and on bug... something that's been fixed and come back.
     
  14. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Hmmmm...
    I think it isn't related to PlayerPrefs, but to the WWW class.
    I saw on the forum other people reporting about "too much recursion" on firefox when downloading AssetBundles or large files.

    I think this was also a problem I saw on our project when tried to run it on firefox, but we wanted the WebGL version only on Chrome, so I didn't try to catch the real problem.

    try to remove the call to download AssetBundles.
    PlayerPrefs should be ok(but they won't work from an iframe as far as I know)
     
  15. DudeGuy

    DudeGuy

    Joined:
    Jul 17, 2014
    Posts:
    19
    Thanks for the input on this. My app does, indeed, run fine when there is no asset bundle downloading even while using PlayerPrefs. But we have quite a bit of content, so I'm not so sure I want it all packed into the final build at this point. I am also mostly only concerned with Chrome at this point, but would still love to run on Firefox.

    As for not working in an iFrame, I've been running my webgl build in an iframe on Facebook and haven't run into any issues with PlayerPrefs so far.
     
  16. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    If you have time - you can test it and send Bug report.
    @jonas echterhoff - do you know about this problem?

    And about the IFrame and PlayerPrefs, maybe it works on some of the browsers, but it doesn't suppose to, as it based on IndexedDB, which shouldn't work on IFrame for security reasons. maybe it isn't like that in all the browsers...
     
  17. mshiro0408

    mshiro0408

    Joined:
    May 8, 2015
    Posts:
    5
    I did not write some of the information .My App is Facebook Canvas App.
    It seems to can not use PlayerPrefs is on the Facebook Iframe.
    But, there is a case where "PlayerPrefs will not be save" is displayed error console,
    Firefox error dialog "too much recursion" is displayed.
     
  18. sandboxr

    sandboxr

    Joined:
    Aug 31, 2012
    Posts:
    2
  19. sumansom

    sumansom

    Joined:
    Jun 4, 2015
    Posts:
    9
    I have a one game which using lots of Playerpref and its working fine on firefox with iFrame.But i have another project which giving me " too much recursion" issue.It seems Playerpref is not responsible for this issue.Please let me know why this issue should be come and how should i solve it.