You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
... and possibly statically, but I haven't checked yet.
The problem is that the thread-local variable CURRENT_INSTANCE, defined in lucet-runtime-internals, ends up appearing in both liblucet-runtime.so and liblucet-wasi.so, but at distinct addresses. So, the lucet-runtime side sets the variable appropriately when entering Wasm, but then the hostcalls implemented in lucet-wasi try and fail to get the current instance from lucet-wasi's copy of the variable. Panic.
Hopefully there's something clever we can do with linking to get around this, because both libraries have to depend on lucet-runtime-internals, and CURRENT_INSTANCE has to be defined in that crate so that the signal handler can reference it. We solved similar problems in the past with exported C function symbols by moving all of the pub extern "C" fns into lucet-runtime, which lucet-wasi does not depend on, but doing the same trick with this TLS variable is going to be difficult.
The text was updated successfully, but these errors were encountered:
Documenting for others. Workaround @enjhnsn2 and I have been using is to create a new rust library project with dependencies to the lucet libraries and outputting a single shared library with all symbols
... and possibly statically, but I haven't checked yet.
The problem is that the thread-local variable
CURRENT_INSTANCE
, defined inlucet-runtime-internals
, ends up appearing in bothliblucet-runtime.so
andliblucet-wasi.so
, but at distinct addresses. So, thelucet-runtime
side sets the variable appropriately when entering Wasm, but then the hostcalls implemented inlucet-wasi
try and fail to get the current instance fromlucet-wasi
's copy of the variable. Panic.Hopefully there's something clever we can do with linking to get around this, because both libraries have to depend on
lucet-runtime-internals
, andCURRENT_INSTANCE
has to be defined in that crate so that the signal handler can reference it. We solved similar problems in the past with exported C function symbols by moving all of thepub extern "C" fn
s intolucet-runtime
, whichlucet-wasi
does not depend on, but doing the same trick with this TLS variable is going to be difficult.The text was updated successfully, but these errors were encountered: