-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support for exceptions .. Disabling emscripten-cxx-exceptions #140
Comments
Looking at the errors, it looks that The issue is that However, even if you get plugins to compile, Proxy-Wasm C++ Host / Envoy / Istio don't support C++ exceptions, so this all might be futile. |
Hi @PiotrSikora .. Thanks for the response. So I've updated the BUILD file for the example like this:
But am still getting the same error? But beyond that we are definitely trying to run a filter that requires exception handling and its disconcerting to hear it won't work in Envoy/Istio. (1) What work is needed to get that support in (and how much/difficult is that work)? (2) Are there workarounds to implement in Envoy/Istio for handling exceptions that wouldn't require modification to the filter? |
I think you need to add a comma between Regarding support for C++ exceptions in Envoy/Istio, there is a bug tracking it here: proxy-wasm/proxy-wasm-cpp-host#116. To be honest, I didn't look at it since the support for native Wasm exceptions was added to V8 and Wasmtime. Perhaps it "just works"? But it looks that Emscripten still uses some JavaScript wrappers for them. Maybe @sbc100 can tell us more? |
Thanks. Yes, exception support seems to work now in V8 as of I think version v9.5 (the latest envoy is using v10.4) and in emscripten as of 3.1.16. I've tried in node and chrome devtools in the browser and both now show the same behavior as compiling C++ to native for the example tried. Perhaps it will work .. we just need to try? About the flag, I tried both ways and tried via the command line but it makes no noticeable impact.
|
Are you sure that we need both |
Yeah, the flag combination is just not at clear to me and obviously will be dependent and become even less clear when considering the version of emscripten matters. I'm using very close to the latest release. It seems the fwasm-exceptions is needed. If I remove that then there is an undefined symbol:
which in quick reading appears to related to the landing location for exception handling. If I remove the -fexceptions on the bazel command I get:
Seems both are needed. I'm wondering if this confusion is managable with bazel build flags or if there is something with emscripten that needs to be filed. I'm hoping to figure this out with the right combination of build flags. |
Hi .. Enabling exceptions for WASM seems to conflict with an -fno-exceptions flag being used by emscripten during linking.
For example, if I add a try and catch in the example and build with:
bazel build //example:http_wasm_example.wasm --features=exceptions
The build fails with the following error:
The line in building.py of a very recent version of emscripten that emits the -fno-exceptions looks like this:
Is there a way to programmatically set the setting of DISABLE_EXCEPTION_CATCHING in bazel build files? Currently I am forced to comment out the lines here.
The text was updated successfully, but these errors were encountered: