You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i run following code in wasm.i receive an error message:Exception: out of bounds memory access
cJSON* jRoot = cJSON_CreateObject();
for (int i = 0; i < 47; i++)//Greater than 46 will prompt: out of bounds memory access
{
string strId = "id"+ std::to_string(i);
cJSON_AddStringToObject(jRoot, strId.c_str(), std::to_string(i).c_str());
}
But run this code in native is ok。 running platform:windows10
When i run following code in wasm.i receive an error message:Exception: out of bounds memory access
cJSON* jRoot = cJSON_CreateObject();
for (int i = 0; i < 47; i++)//Greater than 46 will prompt: out of bounds memory access
{
string strId = "id"+ std::to_string(i);
cJSON_AddStringToObject(jRoot, strId.c_str(), std::to_string(i).c_str());
}
But run this code in native is ok。
running platform:windows10
this is my setting:
![image](https://private-user-images.githubusercontent.com/16358994/336669020-39b1b366-e02d-4760-958b-331275d98e94.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MDc1MTgsIm5iZiI6MTcxOTYwNzIxOCwicGF0aCI6Ii8xNjM1ODk5NC8zMzY2NjkwMjAtMzliMWIzNjYtZTAyZC00NzYwLTk1OGItMzMxMjc1ZDk4ZTk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDIwNDAxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNlNTJlOTY1Y2EyOTQxODExODA0ODRhNjkzNTIyMmEyNGY0NTU5Zjg1NDkyMzYwZGQyMzY2ZWNjMjA1ZDc5MjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GQxdSzkWYhIOFL6EKIjsS5QS5wlh3Ej-Wd3PNpNLeD4)
setting in code:
static char global_heap_buf[21024 1024];
...
init_args.mem_alloc_option.pool.heap_buf = global_heap_buf;
init_args.mem_alloc_option.pool.heap_size = sizeof(global_heap_buf);
Increased the memory, but the problem still exists. how to solve it?
The text was updated successfully, but these errors were encountered: