-
Notifications
You must be signed in to change notification settings - Fork 785
Crash in wasm-opt due to infinite recursion in GenerateStackIR::doWalkFunction #1903
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
Attaching wasm file which reproduces the crash: gui_opengl.wasm.zip |
I don't see a crash on linux, but that might be because linux stacks are 8MB, and I think you're on MacOS, which has smaller ones? So my guess is this is not an infinite recursion, just a very deep one. If so, #1905 should fix it. |
Yep, this was on macOS. I tried running with "ulimit -s 65532" (64MB, the maximum allowed value) now but I still get the crash. |
Odd that didn't fix it. Can you please try with that PR, does that fix it? |
Yes, applying #1905 fixes the issue. Thanks! (looks like removing the debug output there was sufficient, for my test case) |
Thanks for checking! |
When running wasm-opt ./gui_opengl.wasm.pre -o ./gui_opengl.wasm -Os
Using binaryen version_55
Stack trace:
frame #0: 0x000000010000fbb8 wasm-opt
MixedArena::allocSpace(unsigned long, unsigned long) + 8frame #1: 0x000000010014d74a wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 42 frame #2: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387frame #3: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387 frame #4: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387`...
frame #5447: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387frame #5448: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387 frame #5449: 0x000000010014d491 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitPossibleBlockContents(wasm::Expression*) + 177frame #5450: 0x000000010014dc20 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitLoop(wasm::Loop*) + 272 frame #5451: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387frame #5452: 0x000000010014d8a3 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitBlock(wasm::Block*) + 387 frame #5453: 0x000000010014d491 wasm-opt
wasm::StackWriter<(wasm::StackWriterMode)1, wasm::GenerateStackIR::doWalkFunction(wasm::Function*)::Parent>::visitPossibleBlockContents(wasm::Expression*) + 177frame #5454: 0x000000010014d27b wasm-opt
wasm::GenerateStackIR::doWalkFunction(wasm::Function*) + 171 frame #5455: 0x000000010014b62d wasm-opt
wasm::WalkerPass<wasm::PostWalker<wasm::GenerateStackIR, wasm::Visitor<wasm::GenerateStackIR, void> > >::runOnFunction(wasm::PassRunner*, wasm::Module*, wasm::Function*) + 29frame #5456: 0x000000010009bd0b wasm-opt
wasm::PassRunner::runPassOnFunction(wasm::Pass*, wasm::Function*) + 219 frame #5457: 0x000000010009c6de wasm-opt
std::__1::__function::__func<wasm::PassRunner::run()::$_1::operator()() const::'lambda'(), std::__1::allocator<wasm::PassRunner::run()::$_1::operator()() const::'lambda'()>, wasm::ThreadWorkState ()>::operator()() + 110frame #5458: 0x00000001002054c6 wasm-opt
wasm::Thread::mainLoop(void*) + 86 frame #5459: 0x00000001002062dc wasm-opt
void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, void ()(void), wasm::Thread*> >(void*) + 44frame #5460: 0x00007fff6659b305 libsystem_pthread.dylib
_pthread_body + 126 frame #5461: 0x00007fff6659e26f libsystem_pthread.dylib
_pthread_start + 70frame #5462: 0x00007fff6659a415 libsystem_pthread.dylib
thread_start + 13^C
The text was updated successfully, but these errors were encountered: