-
Notifications
You must be signed in to change notification settings - Fork 187
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
clang++ shipped with the wasi-sdk errors with LLVM ERROR: out of memory - clang++ shipped with emscripten is ok #326
Comments
There are several reasons such a difference between the two compiler binaries might exist. Firstly, the emscripten binaries are build against LLVM tip-of-tree so they are built from very different set of sources. Secondly they are built with LTO which would effect all kind of things, including memory usage. How much memory does the machine your running on have? Does the issue still occur on machines with a lot more memory? (i.e. is this just a run of mill OOM, or is it some kind of bug?) |
I don't have anything with more than 64GB, unfortunately. |
How much memory does the emscripten version clang use? I guess you could try building wasi-sdk with clang tip-of-tree to see if there is perhaps a bugfix? |
wasi-sdk doesn't use tip-of-tree llvm, so the next major llvm update would be when llvm 17 is released (which could be a while). |
If llvm 16 accepted a bug fix (assuming that's what it is), would wasi-sdk take it? |
Yes, if a fix is backported to the release/16.x branch, wasi-sdk can update to it. |
Thanks, it looks like upstream is fine. There is clearly a difference between
|
@sunfishcode and I were discussing this: before we decide what to do here we need to understand better what is the difference in behavior between this LLVMv16 Clang and the wasi-sdk Clang. One suggestion would be to compile with |
I could try |
Only thing I've noticed that is different is for WASI SDK the default target is different:
And the LLVM download:
Probably not interesting though? |
Small update,
So problem seems isolated to the Windows build. |
Tried with sdk 21 and problem persists:
|
More info, the x86 version of clang++ fails as above, the x64 version passes. Is there a reason the SDK uses the 32 bit version, do LLVM even support that properly ? |
Wasi-SDK includes the 32 bit version. |
I checked and this is not the case: $ file wasi-sdk-21.0/bin/clang-17
wasi-sdk-21.0/bin/clang-17: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=2b3af36d4a17f9cb2a3c33a3d530eece25498ba6, stripped At least not on Linux, but now I see that your examples are all Windows-based. Can you confirm via some shell output that in fact those binaries are all 32-bit on Windows? Seems a bit weird but maybe there's some |
Sure:
|
Ok, I think this makes things more clear. What might be happening here is that the script that downloads the release artifacts is first extracting the
Maybe a fix for this is to do something similar to the exclusion added to skip one of the Ubuntu versions: wasi-sdk/ci/download-workflow-artifacts.sh Lines 43 to 45 in 3175485
One way to check whether all of this is in fact the case would be to retrieve the |
Yes, I confirm that
|
What's left to do here? Do we need to make a 22.1 release that includes the x64 build of |
This fell off my radar: the issue felt resolved in my mind although in fact no one ever modified |
Yeah, I'll put it on my to-do list and open a PR today or tomorrow. |
This helps ensure the identically-named 32-bit tarfile doesn't overwrite the 64-bit one when we extract everything into a single directory. I'll follow this up by making an updated wasi-sdk-22.0.m-mingw.tar.gz and adding it to the wasi-sdk-22 release. Fixes WebAssembly#326 Signed-off-by: Joel Dice <[email protected]>
I've addressed this for future releases in #417, and @alexcrichton has kindly added https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0.m-mingw64.tar.gz to the |
This helps ensure the identically-named 32-bit tarfile doesn't overwrite the 64-bit one when we extract everything into a single directory. I'll follow this up by making an updated wasi-sdk-22.0.m-mingw.tar.gz and adding it to the wasi-sdk-22 release. Fixes #326 Signed-off-by: Joel Dice <[email protected]>
@dicej, thanks for fixing this! |
Remove emscripten dependency and use correct wasi-sdk url for windows: WebAssembly/wasi-sdk#326
Remove emscripten dependency and use correct wasi-sdk url for windows: WebAssembly/wasi-sdk#326
Using the clang++ shipped with wask-sdk, which reports as 16.0.0:
it fails on windows with some input (a 25MB
.bc
file) withWith emscripten's clang++ (also 16.0.0, but maybe a different commit):
This passes:
The LLVM for the function that is failing is attached, but it might not be that relevant, maybe its just run out of memory in general, this function appears 74% down the input. Also attached the complete
.bc
input.S_P_CoreLib_System_Globalization_UmAlQuraCalendar__InitDateMapping.txt
consoleclrjit.zip
The text was updated successfully, but these errors were encountered: