github-actions[bot] commented on issue #6762:
Subscribe to Label Action
cc @peterhuene
<details>
This issue or pull request has been labeled: "wasmtime:c-api"Thus the following users have been cc'd because of the following labels:
- peterhuene: wasmtime:c-api
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton commented on issue #6762:
Thanks! Can you elaborate a bit more on how this is used though? Async isn't exposed through the C API so in theory this configuration option shouldn't do anything in the C API, but if it's causing issues then that's a bug where when async is turned off it shouldn't be consulted.
guregu commented on issue #6762:
@alexcrichton I agree that's it's more likely a bug somewhere else.
Basically, if I try to set the stack size to 8MB in wasmtime-go it will fail with this message:
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: max_wasm_stack size cannot exceed the async_stack_size', crates/c-api/src/engine.rs:33:38 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 SIGABRT: abort PC=0x198cf4724 m=0 sigcode=0 signal arrived during cgo execution
So I figured exposing this knob could work around that. But perhaps the issue lies elsewhere :thinking:
guregu edited a comment on issue #6762:
@alexcrichton I agree that's it's more likely a bug (or maybe misconfiguration?) somewhere else.
Basically, if I try to set the stack size to 8MB in wasmtime-go it will fail with this message:
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: max_wasm_stack size cannot exceed the async_stack_size', crates/c-api/src/engine.rs:33:38 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 SIGABRT: abort PC=0x198cf4724 m=0 sigcode=0 signal arrived during cgo execution
So I figured exposing this knob could work around that. But perhaps the issue lies elsewhere :thinking:
Would be happy to move this to wasmtime-go issue if that is the case!
guregu commented on issue #6762:
@alexcrichton I made an issue here for the wasmtime-go problem: https://github.com/bytecodealliance/wasmtime-go/issues/182. Please feel free to close this if it's not needed after all!
alexcrichton commented on issue #6762:
Oh no you're all good, I think that this is still a bug in Wasmtime, so this is the right place to fix it. I don't think there's a way to work around that from wasmtime-go right now.
I think the fix though is to update this condition to additionally check
async_support
because if that's disabled then there's no need to test anything about the async stack size, which I think would fix your use case becauseasync_support
isfalse
for the C API.
guregu commented on issue #6762:
Aha, that makes sense! I will take that approach in a new PR. Thank you for the help :pray:
jameysharp commented on issue #6762:
I think that's a good fix to apply. In addition it occurs to me that perhaps the C API should build the
wasmtime
crate with theasync
feature disabled, since it can't make use of the async support anyway. That would have avoided this bug because theif
statement in question wouldn't have been compiled in at all.
guregu commented on issue #6762:
New PR that takes the suggested approach: https://github.com/bytecodealliance/wasmtime/pull/6771
Last updated: Nov 22 2024 at 16:03 UTC