second-state / wasmedge-seL4

Integrate WasmEdge with seL4
Apache License 2.0
44 stars 9 forks source link

"sys_socket not implemented" error in wasmedge_wasi_socket example #7

Open lfern opened 2 years ago

lfern commented 2 years ago

Hi, I have tried to create a wasm version from this repository

https://github.com/second-state/wasmedge_wasi_socket

and execute it getting this error:

# wasmedge_emit /usr/bin/http_server.wasm 
[   23.897756] random: fast init done
[1900-01-00 00:00:00.000] [info] executing wasm file
new connection at 1234
Assertion failed: !"sys_socket not implemented" (/sel4_wasmedge/projects/camkes-tool/libsel4camkes/src/sys_socket.c: camkes_sys_socket: 36)
# 

I had to change this dependency in the cargo.toml, from 0.2.0 to 0.1.0 version (because I got an error related to number of parameters of the sock_accept function):

wasmedge_wasi_socket = "0.1.0"

Please, do you know how to fix this error? Thanks!!!!

juntao commented 2 years ago

A limitation of seL4 is that it does not support the standard libc. We had to make significant changes to WASI implementation to use seL4's OS services instead of libc in order to port WasmEdge to seL4.

The WasmEdge socket api is based on libc and has not been ported to seL4 yet.

Do you have a specific use case? If so, we can try to collaborate on this. Thanks!

lfern commented 2 years ago

We don't have a specific use case, but we were trying to avoid the use of the Linux TCP/IP stack in the VM (https://www.mail-archive.com/devel@sel4.systems/msg03176.html), and we found your article:

https://www.cncf.io/blog/2021/11/11/containerization-on-the-edge/

So if we could execute a simple HTTP server as a camkes component, it should be even better.

We are still learning about sel4, and still don't know so much about wasm, but if you think I could help with this and learn a little bit about both projects, I would be glad to collaborate.