-
Notifications
You must be signed in to change notification settings - Fork 30
Metadata doesn't work on runtime #20
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
Comments
@kateinoigakukun do you think this could be the reason for current crashes of
|
Yes! Debugging is very hard 😅 |
Have you tried it with wasmer? We can help a bit to debug what's going on :) |
@syrusakbary Thanks, I tried wasmer but I couldn't get any debug information from that.
Is there any way to debug like lldb and see the stack on wasmer? |
A quick update on my progress. I'm working on supporting 64bit absolute pointer for metadata on x86_64 first because debugging on wasm is very hard. I found there are many logics based on 4byte relative pointer and the metadata structures are broken for 8 byte alignment. For example, |
FWIW, I'm seeing a different error with a bit more information than Max gets. But it's definitely metadata-related:
|
@kateinoigakukun interesting, do you know of any browsers that provide wasm64 support? AFAIK there are no stable versions with wasm64 from any major vendor, even LLVM itself currently doesn't support wasm64. |
Oh, I didn't know that LLVM doesn't support wasm64 😢 Thanks! |
I'm not sure that wasm64 part is even specced, just looking at how it's still referred to as a "future feature":
I'm not aware of such APIs for querying this existing in any available runtime. |
As far as I investigated, it fails to deference absolute pointer.
Absolute Pointer?
In apple/swift, they use relative pointer which has an offset between its own address and pointee. But linker support is necessary to calculate the offset and wasm-ld doesn't have the subtraction relocation type yet.
To avoid relative pointer, @zhuowei changed to replace the offset with absolute pointer instead and it works well.
But there are some issues in this way.
Issues
@zhuowei's change doesn't work in latest swiftwasm branch and I don't know when this way was broken.
@zhuowei's patch was applied into RelativePointer.h directly. This change makes it difficult to support wasm64 because the relative pointer's offset is designed to be int32.
What we need to do
There are some ways to solve these issues.
If wasm-ld supports the relocation type, we need nothing to do except reverting absolute pointer patch.
I'm contacting llvm people now for this topic. WebAssembly/tool-conventions#132
I'm implementing AbsolutePointer type and make it more robust to support 64bit environment.
The text was updated successfully, but these errors were encountered: