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
Miscompiled operation in LLVM Wasm backend causes data corruption in dav1d #8173
Comments
Thanks for the testcase @Brion! Based on that description it does sound like an LLVM bug, with having
It has the proper Perhaps this was fixed in that short internal, @aheejin @tlively? I do seem to recall a similar-sounding bug being fixed in the recent, but not that recent, past. @Brion, is there some chance your path contains an older LLVM, or the LLVM env var pointing it to an older version? ( |
Hmm, I still get the error with latest-upstream-3453, without the and... Don't seem to have any stray LLVM. Here's the and my
Note the system |
(Using python3 makes no difference, as I expected.) Clearly something's wonky, I just don't know what. :) |
From the code snippet above, it looks a lot like https://bugs.llvm.org/show_bug.cgi?id=40805, for which a fix landed on trunk yesterday. |
@sunfishcode yeah I think that's it. :) @kripken with a fresh emsdk install it builds correctly with upstream-3454, which I think is new enough to include the fix mentioned above. :D I noticed another problem -- emsdk doesn't download new versions of the upstream |
Oh wow, interesting timing here. Thanks everyone! @Brion Fix for that emsdk issue is here - emscripten-core/emsdk#223 , pretty silly bug... |
Awesome, I can put this one to bed. :) Thanks everyone! Closing out this issue. |
While testing the LLVM Wasm backend (with latest-upstream-3441) for ogv.js's codec modules, I found that the dav1d AV1 decoder has some weird image data corruption when compiling at -O1 or higher.
I tracked it down to the
padding
function inlooprestoration_tmpl.c
, and poking the disassembly turned up a bit where a bitfield check was being treated like a direct boolean value, causing it to fail when other bitfield values were present. This caused logic errors leading to corrupted image data. I can correct the .wast manually, re-assemble it, and confirm it works.I've put an isolated test case at https://github.com/brion/emscripten-llvm-funky-bug including the wasm and llvm IR disassembly.
The text was updated successfully, but these errors were encountered: