Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Sakuwwz · Jan 20, 2020 at 05:19 AM · webglexceptionmemory usage

Retrieving Data from websocket for Unity WebGL game leads to an exception : “Uncaught RuntimeError: memory access out of bounds at wasm-function”

I've been trying to retrieve data from websocket to my unity webgl game. It's working fine and validating successfully to authorize the user. But As soon as calling the function to retrieve the data and populate the lists, arrays and Dictionaries that I defined, Its throwing and error like below in the build and deploy in the instance.

This is how I do the stuff.

     IEnumerator RetrieveWordsAndDefs(string accessTokenGetData)
         {
             string getDataFromURLLocal = "https://api.samplecloud.com/gamequestion?site=" + site + "&game=" + gameId + "&access_token=" + accessToken + "&token_type=Bearer";
             using (UnityWebRequest uwr = UnityWebRequest.Get(getDataFromURLLocal))
             {
                 uwr.SetRequestHeader("Content-Type", CONTENT_TYPE);
                 uwr.SetRequestHeader("x-api-key", X_API_KEY);
                 bool onetimeGet;
                 yield return uwr.SendWebRequest();
 
                 if (uwr.isNetworkError)
                 {
                     Debug.Log("Error While Sending: " + uwr.error + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError);
                     //messageText5.text = "Error While Sending: " + uwr.error + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError;
                 }
                 else
                 {
                     Debug.Log("Received: Data" + uwr.downloadHandler.text + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError);
                     string jsonWordAndDefs = uwr.downloadHandler.text;
                     DeserializeJsonData(jsonWordAndDefs);
                 }
             }
         }
 
 
 private void DeserializeJsonData(string jsonWordAndDefs)
     {
         words = null;
         def = null;
         singleText = null;
 
         if (!String.IsNullOrEmpty(jsonWordAndDefs))
         {
             RootObjectData rootObjectData = JsonUtility.FromJson<RootObjectData>(jsonWordAndDefs);
 
             int count = rootObjectData.tasks[0].words.Count;
 
             def = rootObjectData.tasks[0].words.Zip(rootObjectData.tasks[0].definitions, (k, v) => new { k, v }).ToDictionary(x => x.k, x => x.v);
             words = rootObjectData.tasks[0].words.ToArray();
             singleText = rootObjectData.tasks[0].definitions.ToArray();
 
             words = words.Where(x => !string.IsNullOrEmpty(x)).ToArray();
             words = words.Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
 
             foreach (KeyValuePair<string, string> kvp in def)
             {
                 //messageText1.text += string.Format("{0} : {1} \n", kvp.Key, kvp.Value);
             }
 
         }
     }

But when I deploy it in my websocket and and Run, I'm getting this errors to be appear in console of web browser

exception thrown: RuntimeError: index out of bounds,@blob:https://sample

 Uncaught RuntimeError: memory access out of bounds
     at wasm-function[19588]:0x81e4f1
     at wasm-function[42109]:0xcaa7fc
     at Object.dynCall_iii...

does anyone know how to solve this issue? any suggestion would be really helpful. Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MsAnonymous · Sep 27, 2020 at 01:43 PM

Any news on this issue? Same problem here!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

124 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to monitor memory usage in WebGL? 1 Answer

How to optimize memory usage in webgl applications 0 Answers

Unity WebGL build memory discrepancy in local hosted and web hosted 0 Answers

GameObject.FindWithTag throws an exception since updating to Unity 5.6, but only in WebGL export, not in Editor 1 Answer

when build to webGL 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges