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

Rust sdk does not work, cannot create an instance "thread signal env initialized failed" #3627

Open
macko99 opened this issue Jul 13, 2024 · 4 comments

Comments

@macko99
Copy link

macko99 commented Jul 13, 2024

Hello, would you be able to help me with creating WAMR containerd shim?

I have created some PR but I end up with one of the errors:

-"thread signal env initialized failed"
-without any error
-"error running start function: Failed to create instance: InstantiationFailure("error while pre-opening mapped directory: invalid map"
-"Running "_start"" then "Error: ExecutionError("Exception: unreachable")"

My module has only the main function defined.
I have tried disabling hardware checks in WAMR since I'm working on the VM, commit

@lum1n0us
Copy link
Collaborator

error while pre-opening mapped directory: invalid map

means the wasi argument isn't set correctly. if using iwasm, you might want to use --dir or --map-dir to config WASI.

@macko99
Copy link
Author

macko99 commented Jul 14, 2024

@lum1n0us I'm using the wamr-rust-sdk

@lum1n0us
Copy link
Collaborator

@macko99
Copy link
Author

macko99 commented Jul 14, 2024

@lum1n0us please take a look at the PR

I do set
let wasi_ctx = WasiCtxBuilder::new() .set_pre_open_path(vec!["/"], vec!["/"]) .set_env_vars(envs.iter().map(String::as_str).collect()) .build();

I have also tried with other dirs, just like in an example, it fails with "Error: ExecutionError("Exception: unreachable")"

To clarify:
-when setting envs by set_env_vars the shim exists with no error or "thread signal env initialized failed"
-when setting set_pre_open_path to "/:/" I get "error running start function: Failed to create instance: InstantiationFailure("error while pre-opening mapped directory: invalid map"
-when setting set_pre_open_path to ".:" I get "Error: ExecutionError("Exception: unreachable")"

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