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

APISIX load wasm plugin report error in macosx platform? #122

Open
jthann opened this issue Jul 11, 2022 · 1 comment
Open

APISIX load wasm plugin report error in macosx platform? #122

jthann opened this issue Jul 11, 2022 · 1 comment

Comments

@jthann
Copy link

jthann commented Jul 11, 2022

OS Platform Info:

Darwin 20.4.0 x86_64

Build Process:

1、Using APISIX build tools git@github.com:api7/apisix-build-tools.git tag:apisix/2.13.2
Runnging build-apisix-base.sh to build openresty and the result is successful.
2、Building APISIX git@github.com:apache/apisix.git tag: 2.13.2
Running make deps to build APISIX and the result is successful.
3、Compile wasm plugin:
tinygo build -o ./fault-injection/main.go.wasm -scheduler=none -target=wasi ./fault-injection/main.go
The main.go.wasm absolute path is /Users/John/fault-injection/main.go.wasm
4、Modify APISXIX config.yaml

wasm:
  plugins:
    - name: wasm-fault-injection
      priority: 7999
      file: /Users/John/fault-injection/main.go.wasm
      http_request_phase: access

5、Start APISIX sudo ./bin/apisix start

The ./logs/error.log as following

2022/07/11 16:59:57 [info] 27964#31196182: loaded wasm plugin
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27964#31196182: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27964#31196182: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27964#31196182: *13 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
2022/07/11 16:59:57 [info] 27955#31196172: loaded wasm plugin
2022/07/11 16:59:57 [info] 27953#31196170: loaded wasm plugin
2022/07/11 16:59:57 [info] 27952#31196169: loaded wasm plugin
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [info] 27961#31196179: loaded wasm plugin
2022/07/11 16:59:57 [error] 27952#31196169: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27961#31196179: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27952#31196169: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27952#31196169: *2 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
2022/07/11 16:59:57 [info] 27959#31196177: loaded wasm plugin
2022/07/11 16:59:57 [info] 27950#31196167: loaded wasm plugin
2022/07/11 16:59:57 [info] 27957#31196175: loaded wasm plugin
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27950#31196167: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27961#31196179: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27961#31196179: *12 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
2022/07/11 16:59:57 [info] 27956#31196173: loaded wasm plugin
2022/07/11 16:59:57 [info] 27950#31196167: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27950#31196167: *1 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27956#31196173: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27960#31196178: loaded wasm plugin
2022/07/11 16:59:57 [info] 27956#31196173: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27956#31196173: *7 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
2022/07/11 16:59:57 [info] 27958#31196176: loaded wasm plugin
2022/07/11 16:59:57 [info] 27951#31196168: loaded wasm plugin
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27951#31196168: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27951#31196168: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27951#31196168: *3 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
2022/07/11 16:59:57 [info] 27954#31196171: loaded wasm plugin
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port', crates/runtime/src/traphandlers/macos.rs:425:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2022/07/11 16:59:57 [error] 27954#31196171: failed to call function: assertion failed: `(left == right)`
  left: `268435466`,
 right: `0`: failed to set thread exception port�
2022/07/11 16:59:57 [info] 27954#31196171: unloaded wasm plugin
2022/07/11 16:59:57 [error] 27954#31196171: *5 [lua] plugin.lua:110: load_plugin(): failed to load plugin [wasm-fault-injection] err: failed to load wasm plugin, context: init_worker_by_lua*
@spacewander
Copy link
Contributor

spacewander commented Jul 12, 2022

Look like it crashed into the rust crates which wasmtime depends on.
Can you reproduce it in Linux (I don't have Mac to test it)?

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