Segfault in v7 when working with tables

On Ubuntu 20.04, upgraded my application from JUCE v6 to v7. Having a problem with a segfault deep in the JUCE callstack, and figured I’d post in case anyone else ran into this and found the cause.

Thread 1 received signal SIGSEGV, Segmentation Fault.  0xffffffffffffffff in ?? ()

Canvas is a TableListBox + TableListBoxModel. I’ve commented out all my code in overridden methods like paintRowBackground() and paintCell() but on startup I’m still seeing a segfault here:

#0  juce::Image::BitmapData::BitmapData(juce::Image const&, juce::Image::BitmapData::ReadWriteMode) (this=0x7fffd0fc2b50, im=..., mode=juce::Image::BitmapData::readWrite) modules/juce_graphics/images/juce_Image.cpp:409
#1  0x0000555555ea1a2c in juce::RenderingHelpers::SoftwareRendererSavedState::fillWithSolidColour<juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIterator>(juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::SubRectangleIterator&, juce::PixelARGB, bool) const (this=0x7fff6c695770, iter=..., colour=..., replaceContents=false) modules/juce_graphics/native/juce_RenderingHelpers.h:2600
#2  0x0000555555ea01a1 in juce::RenderingHelpers::ClipRegions<juce::RenderingHelpers::SoftwareRendererSavedState>::RectangleListRegion::fillRectWithColour(juce::RenderingHelpers::SoftwareRendererSavedState&, juce::Rectangle<int>, juce::PixelARGB, bool) const (this=0x7fff36165970, state=..., area=..., colour=..., replaceContents=false) modules/juce_graphics/native/juce_RenderingHelpers.h:1854
#3  0x0000555555ea68fc in juce::RenderingHelpers::SavedStateBase<juce::RenderingHelpers::SoftwareRendererSavedState>::fillTargetRect(juce::Rectangle<int>, bool) (this=0x7fff6c695770, r=..., replaceContents=false) modules/juce_graphics/native/juce_RenderingHelpers.h:2227
#4  0x0000555555ea31c6 in juce::RenderingHelpers::SavedStateBase<juce::RenderingHelpers::SoftwareRendererSavedState>::fillRect(juce::Rectangle<int>, bool) (this=0x7fff6c695770, r=..., replaceContents=false) modules/juce_graphics/native/juce_RenderingHelpers.h:2267
#5  0x0000555555ea07a0 in juce::RenderingHelpers::StackBasedLowLevelGraphicsContext<juce::RenderingHelpers::SoftwareRendererSavedState>::fillRect(juce::Rectangle<int> const&, bool) (this=0x7fff304d2ba0, r=..., replace=false) modules/juce_graphics/native/juce_RenderingHelpers.h:2720
#6  0x0000555555df990e in juce::Graphics::fillAll(juce::Colour) const (this=0x7fffd0fc3060, colourToUse=...) modules/juce_graphics/contexts/juce_GraphicsContext.cpp:554
#7  0x0000555555f3623e in juce::LookAndFeel_V2::fillResizableWindowBackground(juce::Graphics&, int, int, juce::BorderSize<int> const&, juce::ResizableWindow&) (this=0x5555568beb30, g=..., window=...) modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp:1864
#8  0x0000555555f8ad8a in juce::ResizableWindow::paint(juce::Graphics&) (this=0x7fff35d579e0, g=...) modules/juce_gui_basics/windows/juce_ResizableWindow.cpp:366
#9  0x0000555555f88c83 in juce::DocumentWindow::paint(juce::Graphics&) (this=0x7fff35d579e0, g=...) modules/juce_gui_basics/windows/juce_DocumentWindow.cpp:189
#10 0x0000555555ef632c in juce::Component::paintComponentAndChildren(juce::Graphics&) (this=0x7fff35d579e0, g=...) modules/juce_gui_basics/components/juce_Component.cpp:2019
#11 0x0000555555ef69ce in juce::Component::paintEntireComponent(juce::Graphics&, bool) (this=0x7fff35d579e0, g=..., ignoreAlphaLevel=true) modules/juce_gui_basics/components/juce_Component.cpp:2116
#12 0x0000555555f86336 in juce::ComponentPeer::handlePaint(juce::LowLevelGraphicsContext&) (this=0x7fff6c022760, contextToPaintTo=...) modules/juce_gui_basics/windows/juce_ComponentPeer.cpp:135
#13 0x000055555601314d in juce::LinuxComponentPeer::LinuxRepaintManager::performAnyPendingRepaintsNow() (this=0x7fff6d698bd0) modules/juce_gui_basics/native/juce_linux_Windowing.cpp:490
#14 0x00005555560124df in juce::LinuxComponentPeer::performAnyPendingRepaintsNow() (this=0x7fff6c022760) modules/juce_gui_basics/native/juce_linux_Windowing.cpp:307
#15 0x0000555555ef25a2 in juce::Component::addToDesktop(int, void*) (this=0x7fff35d579e0, styleWanted=409, nativeWindowToAttachTo=0x0) modules/juce_gui_basics/components/juce_Component.cpp:762
#16 0x0000555555f8dc2e in juce::TopLevelWindow::addToDesktop(int, void*) (this=0x7fff35d579e0, windowStyleFlags=409, nativeWindowToAttachTo=0x0) modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp:278
#17 0x0000555555ef2ee0 in juce::Component::setAlwaysOnTop(bool) (this=0x7fff35d579e0, shouldStayOnTop=true)

The line in question with the segfault in BitmapData() at line 409 is im.image->initialiseBitmapData (*this, 0, 0, mode); and in debug mode (where the segfault still happens) looking at the variables the “image” is not nullptr:

I’m sorry I can’t help you with your Juce 7 issue, but your post made me very curious: What debugger/IDE (on Linux I assume) produced the image you attached?

1 Like

Looks like ddd to me:
https://www.gnu.org/software/ddd/

3 Likes