Coder Social home page Coder Social logo

Comments (9)

tpmccallum avatar tpmccallum commented on May 21, 2024 2

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.

tpmccallum avatar tpmccallum commented on May 21, 2024 2

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.

alabulei1 avatar alabulei1 commented on May 21, 2024

Thanks for your feedback.
@juntao and @tpmccallum could you take a look? Maybe because we renamed the SSVM to WasmEdge-core?

from wasm-joey.

tpmccallum avatar tpmccallum commented on May 21, 2024

Hi,
Thanks, checking on this now.
Tim

from wasm-joey.

tpmccallum avatar tpmccallum commented on May 21, 2024

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.

tpmccallum avatar tpmccallum commented on May 21, 2024

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.

tpmccallum avatar tpmccallum commented on May 21, 2024

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.

burakakca avatar burakakca commented on May 21, 2024

Yes, works well. If i get similar new error, can i open this issue

from wasm-joey.

tpmccallum avatar tpmccallum commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.