Crash on Resizing window in Linux

Hi!

I’m getting a reliable crash with linux standalone when zooming in surge with a low level xwindows crash. It looks like after I resize (with AudioProcessorEditor::setScale) that in some cases the xwindow state is not ready or not refreshed when you check isComponentShowing.

Reproducing is a bit tricky but if I build surge at head, set zoom to 125%, then choose ‘grow by 10%’ it happens every time right now.

The stack I get looks like this which makes me think the resize has reset internal state but hasn’t broadcast it to components properly yet, and then is trying to redraw. But I’m having a hard time making heads or tails of it.

I’ll keep digging of course but wondering if this rings any bells for anyone? I’m on 6.1.1 right now but doesn’t seem any diffs in this code to 6.1.2.

Thanks!

#0  0x00007ffff7651c38 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#1  0x00007ffff76520df in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff764fe9f in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff765161f in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#4  0x00007ffff7651796 in xcb_wait_for_reply64 () from /lib/x86_64-linux-gnu/libxcb.so.1
#5  0x00007ffff76acee8 in _XReply () from /lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007ffff76927e8 in XGetWindowProperty () from /lib/x86_64-linux-gnu/libX11.so.6
#7  0x00005555557d722c in juce::XWindowSystemUtilities::GetXProperty::GetXProperty (this=0x7fffff7ff560, window=44040198, atom=356, offset=0, length=64, shouldDelete=false, 
    requestedType=356) at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:169
#8  0x00005555557db974 in juce::XWindowSystem::isMinimised (this=0x555557b6b270, windowH=44040198)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:1842
#9  0x0000555555849275 in juce::LinuxComponentPeer::isMinimised (this=0x555557b80a70)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:177
#10 0x000055555572c25f in juce::Component::isShowing (this=0x555557b806b0) at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:602
#11 0x000055555572c22f in juce::Component::isShowing (this=0x555557e2a390) at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:599
#12 0x000055555572c22f in juce::Component::isShowing (this=0x555557dbd6b0) at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:599
#13 0x000055555572da15 in juce::Component::setBounds (this=0x555557dbd6b0, x=0, y=22, w=914, h=6572)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:1115
#14 0x000055555572e04f in juce::Component::setBounds (this=0x555557dbd6b0, r=...)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:1217
#15 0x0000555555755f58 in juce::ComponentBoundsConstrainer::applyBoundsToComponent (this=0x555557dbd7a8, component=..., bounds=...)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp:147
#16 0x0000555555755e80 in juce::ComponentBoundsConstrainer::setBoundsForComponent (this=0x555557dbd7a8, component=0x555557dbd6b0, targetBounds=..., isStretchingTop=false, 
    isStretchingLeft=false, isStretchingBottom=true, isStretchingRight=false)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp:133
#17 0x000055555566b428 in juce::AudioProcessorEditor::setBoundsConstrained (this=0x555557dbd6b0, newBounds=...)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp:165
#18 0x0000555555c06f49 in juce::StandaloneFilterWindow::MainContentComponent::resized (this=0x555557e2a390)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h:907
#19 0x000055555572dcd1 in juce::Component::sendMovedResizedMessages (this=0x555557e2a390, wasMoved=false, wasResized=true)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:1179
#20 0x000055555572dbeb in juce::Component::sendMovedResizedMessagesIfPending (this=0x555557e2a390)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:1161
#21 0x000055555572db67 in juce::Component::setBounds (this=0x555557e2a390, x=4, y=30, w=1234, h=8902)
    at /home/paul/ldev/surge-xt/libs/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:1147
#22 0x000055555572dee0 in juce::Component::setSize (this=0x555557e2a390, w=1234, h=8902)

For me, I see a very similar crash but the stack is a zillion frames deep, so I suspect there’s some unchecked recursion happening. I think that the editor resizing causes the StandaloneFilterWindow to resize, which in turn tries to update the editor’s size. Then the cycle continues.

For me, this patch seems to solve the problem:

resize.patch (2.3 KB)

Could you try this out and check whether it solves the issue for you? Thanks!

That patch 100% resolves my problem. I have a fully reproducible crash on resize against 6.1.2 without it applied and applying it solves the crash. Wonderful.

Think it’s mergeable into a 6.1.3? We have a while before our release so no rush here, and i can patch ours also if its not.

Thanks, as always, for the fast and accurate response.

I’m not sure when we’ll next be doing a release (we have anything planned right now) but I expect this will make it onto develop in the next few days, once it’s been reviewed by the team.

Awesome! I have surge set up on a fork (with no diffs) anyway so I can just release on “6.1.2 + this diff” if needs be.

Super appreciated!

That’s on develop now:

Thank you! I’ll update to 6.1.2 + that commit this weekend for surge.

Appreciated as always.