Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error: table index is out of bounds. #203

Open
sukrucildirr opened this issue Jan 25, 2024 · 6 comments
Open

Runtime error: table index is out of bounds. #203

sukrucildirr opened this issue Jan 25, 2024 · 6 comments

Comments

@sukrucildirr
Copy link

Is your feature request related to a problem? Please describe.

After connecting wallet and request to mint, I'm getting " table index is out of bounds " and screen is not responding.
image

Describe the solution you'd like

  • Check the size of the table before accessing an index: Before accessing an index in a table, always check that the index is less than the size of the table.
  • Use the ipairs function for iterating over tables: The ipairs function in Lua is specifically designed for iterating over tables. It skips over any nil values and only iterates over the existing indices.
  • Use the pairs function for iterating over tables: The pairs function in Lua iterates over all elements in the table, including nil values. If you're using pairs, make sure to check for nil values.
  • Check the size of the table after modifying it: If you're modifying the table (adding or removing elements) during iteration, make sure to check the size of the table again after each modification.
@GabrielePicco
Copy link
Collaborator

@gangstarr60 can you please share the full stack trace and perhaps a video/screenshot on how to reproduce the issue?
Would be helpful to know the wallet and browser used.

The described solution you posted seems GPT generated. We are not using Lua.

@sukrucildirr
Copy link
Author

I got the explained error and tried with ai. I don't have more information about this language.
Wallet : phantom
Browser : chrome

@GabrielePicco
Copy link
Collaborator

No problems. Thanks for reporting it @gangstarr60 .
Can you please copy paste the full stack trace (the error logged in the console) and describe the steps to reproduce the issue?

@sukrucildirr
Copy link
Author

My page is not responding after when i click somewhere. Then gives runtime error

[ An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:

RuntimeError: memory access out of bounds

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[548]:0x7a3f1

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[15496]:0x8ab693

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[26517]:0xfeb587

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[35210]:0x15867ab

at invoke_viiii (https://magicblock-labs.github.io/Solana.Unity- SDK/Build/Solana.Unity-SDK.framework.js:10:382263)

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[31256]:0x132c075

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[65776]:0x1d57469

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unitv-SDK.wasm:wasm-functionl449461:0x1733bd1

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[1256]:0xb349b

at https://magicblock-labs.github.io/Solana.Unity-SDK/Build/ Solana.Unity-SDK.wasm:wasm-function[35214]:0x15867e5

at invoke_viii (https://magicblock-labs.github.io/Solana.Unity- SDK/Build/...
]

@GabrielePicco
Copy link
Collaborator

I'm unable to reproduce the issue unfortunately, the hosted demo work correctly on all the setup I tested.
Could you please specify OS, browser version and anything you think is relevant to reproduce on my end.

@sukrucildirr
Copy link
Author

Windows 10 Home Single Language
Chrome 121.0.6167.140
Phantom wallet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants