Comments (9)
Hi @juntao @alabulei1 and @burakakca
This should now be resolved.
@burakakca please install the latest wasmedge-extensions
as per this documentation and try again.
from wasm-joey.
Here you can see a new hello
example (taken from this example) which I have uploaded to the Function As A Service (FaaS) which runs the same software. You can try calling it via Curl command in your Linux/Mac Command Line Interface (CLI)
curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/452/say' \
--header 'Content-Type: text/plain' \
--data-raw 'Tim'
Returns
hello Tim
from wasm-joey.
Thanks for your feedback.
@juntao and @tpmccallum could you take a look? Maybe because we renamed the SSVM to WasmEdge-core?
from wasm-joey.
Hi,
Thanks, checking on this now.
Tim
from wasm-joey.
Hi,
It seems that this is only an issue with the AOT compiled binary.
For example, if I compile this hello world example [1] using rustwasmc build
and then run the .wasm
using the following node CLI (for simplicity and demonstration purposes) it works find.
// Create ssvm instance
const ssvm = require("wasmedge-extensions");
// Load Wasm
const path = "/home/tpmccallum/hello_lib_bg.wasm";
vm = new ssvm.VM(path, { args:process.argv, env:process.env, preopens:{"/": "/tmp"} });
// Run function
var return_value = vm.RunString("say", "asdf");
console.log("Return value: " + return_value);
The following output shows success
$ node tester.js
Return value: hello asdf
Alternatively, if I use AOT compile process and run the .so
instead of the .wasm
then an issue occurs.
// Create ssvm instance
const ssvm = require("wasmedge-extensions");
// Load Wasm
const path = "/home/tpmccallum/hello_lib_bg.wasm";
vm = new ssvm.VM(path, { args:process.argv, env:process.env, preopens:{"/": "/tmp"} });
// AOT
vm.Compile(aot_path);
var vm_aot = new ssvm.VM(aot_path, { EnableAOT:true, rgs:process.argv, env:process.env, preopens:{"/": "/tmp"} });
// Run function
var return_value = vm_aot.RunString("say", "asdf");
console.log("Return value: " + return_value);
The following output shows the error
[2021-10-20 09:59:08.164] [error] execution failed: out of bounds memory access, Code: 0x88
[2021-10-20 09:59:08.164] [error] When executing function name: "__wbindgen_malloc"
[2021-10-20 09:59:08.164] [error] execution failed: function signature mismatch, Code: 0x83
[2021-10-20 09:59:08.164] [error] Mismatched function type. Expected: params{i32 , i32 , i32} returns{} , Got: params{i32} returns{}
[2021-10-20 09:59:08.164] [error] When executing function name: "say"
/media/nvme/node_rpc/wasm-joey/src/testing_using_node/tester.js:25
var return_value = vm_aot.RunString("say", "asdf");
^
Error: out of bounds memory access
at Object.<anonymous> (/media/nvme/node_rpc/wasm-joey/src/testing_using_node/tester.js:25:27)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47 {
code: 'Error'
}
[1] https://github.com/second-state/wasm-learning/tree/master/faas/hello
from wasm-joey.
I see there was just an update regarding memory so I am just updating wasmedge-extensions
to lastest 0.8.2
and will try this again.
from wasm-joey.
Hi @alabulei1 & @burakakca
I would like to update to all the latest code and then share the outcome.
There is an issue [1] in relation to wasmedge-extensions installer which when fixed will allow us to use the latest code.
I will get back to you asap.
Thanks
[1] second-state/wasmedge-extensions#3
from wasm-joey.
Yes, works well. If i get similar new error, can i open this issue
from wasm-joey.
Hi @burakakca
Great to hear it is now working as intended.
Yes, sure thing. Please share any new errors so that we can help out.
Thanks for sharing.
from wasm-joey.
Related Issues (20)
- Specify a “callback url” in the header HOT 4
- Move the wasm_description to the header HOT 5
- Implement multipart/form-data to support html file upload HOT 2
- Implement header prefix of SSVM HOT 1
- Specify an "argument_url" in the header HOT 4
- Provide logging via `logging_callback_url` HOT 3
- Add logic for cases where wasm_id does not exist HOT 1
- Support stateful context HOT 2
- Support text/plain in /api/state HOT 1
- Limit the number of callbacks to rpc.ssvm.secondstate.io HOT 1
- Allow caller to submit request and then terminate request/response process HOT 1
- Levels of logging (verbose vs minimal) HOT 1
- Add unique parameter i.e. `joey_remote_url` or `joey_arg_url` for remote m2m data exchange HOT 1
- Documentation
- Provide easy access to store small amounts of data frequently HOT 2
- Enquire about return_value of RunUint8Array HOT 1
- Test new issue template
- Write tests for multipart using every combination of GET, POST and Callback HOT 1
- ⚠️ Prevent SQL injection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-joey.