Skip to content

WASM extension crashes on Big-endian machine #197

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

Closed
knm3000 opened this issue Nov 8, 2021 · 0 comments · Fixed by #198
Closed

WASM extension crashes on Big-endian machine #197

knm3000 opened this issue Nov 8, 2021 · 0 comments · Fixed by #198

Comments

@knm3000
Copy link
Contributor

knm3000 commented Nov 8, 2021

Rust WASM extension https://github.com/maistra/header-append-filter crashes on s390x:

2021-09-07T17:11:51.327902Z     error   envoy wasm      Function: proxy_on_configure failed: Uncaught RuntimeError: memory access out of bounds
Proxy-Wasm plugin in-VM backtrace:
  0:  0x1aa1 - _ZN10serde_json5value2de77_$LT$impl$u20$serde..de..Deserialize$u20$for$u20$serde_json..value..Value$GT$11deserialize17hb4f81bdbc27fce53E.llvm.10413096860284390022
  1:  0x17fa - _ZN10serde_json2de10from_slice17had30ef6d3adf186fE
  2:  0x64a0 - _ZN97_$LT$header_append_filter..HeaderAppendRootContext$u20$as$u20$proxy_wasm..traits..RootContext$GT$12on_configure17h5f96597ce1e2a394E
  3:  0xfffa - _ZN10proxy_wasm10dispatcher10Dispatcher12on_configure17h4a9f78f0de537835E
  4:  0x1220a - proxy_on_configure
2021-09-07T17:11:51.327927Z     error   envoy wasm      Wasm VM failed Failed to configure base Wasm plugin
2021-09-07T17:11:51.328771Z     critical        envoy wasm      Plugin configured to fail closed failed to load
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Nov 8, 2021
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Nov 19, 2021
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Nov 25, 2021
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Jan 7, 2022
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Jan 24, 2022
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Jan 28, 2022
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Feb 3, 2022
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Feb 3, 2022
Use htole32() and le32toh() instead of __builtin_bswap32()
Moved byte reversals into `setWord()`

Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Feb 3, 2022
Use htole32() and le32toh() instead of __builtin_bswap32()
Moved byte reversals into `setWord()`
Defined htole32() and le32toh() for macos

Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
knm3000 added a commit to knm3000/proxy-wasm-cpp-host that referenced this issue Feb 4, 2022
Use htole32() and le32toh() instead of __builtin_bswap32()
Moved byte reversals into `setWord()`
Defined htole32() and le32toh() for macos
Reverse in setWord() for wasmtime, wamr and wavm

Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
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

Successfully merging a pull request may close this issue.

1 participant