Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


On 06/11/2018 10:19, Caolán McNamara wrote:
On Mon, 2018-11-05 at 20:46 +0100, Julien Nabet wrote:
Looking at git history from
vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-1.svm, I got
d776eeab752fd313226a7570c3ed4d8e964b4406

"ofz#937 sanity check claimed record length"
Documents like that are generated from the oss-fuzz fuzzing thing, and
what matters generally is that we don't crash/busy-loop on loading
them, not that they are in any way sane documents.
No pb, the oss-fuzz revealed a lot of bugs.
1) Do you think these asserts are ok?
I have my doubts that a negative width/height is something that is
guaranteed to indicate a bug, though it might indeed be suspicious.

I'm not completely sure too but there's no doc about this and putting an height or a width to a negative value (except -1 to tell it's uninitialized) seems really weird.

2) If yes, any thoughts how to fix this specific test with the svm
(hoping there won't be more but I'm a bit pessimistic about this)?
Well, for the purposes of continuing your experiment I imagine you
could just consider negative nTmp32 for width/height as failures and
return early.

As you may have seen, I pushed https://cgit.freedesktop.org/libreoffice/core/commit/?id=6aa6cb6347575828a9d6955b98f459c7446eca05

Then I fixed a second assert with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=d467214ac24e22818ff933d76148f3f0987c65ca

Now I'm stuck with a third assert (see bt + gdb). I thought I'd stumble about the same bt as https://ci.libreoffice.org/job/gerrit_master/18918/ gerrit Linux clang dbgutil, I suppose it's rendering dependent (in my case gtk3).

Putting some break, I found that it was coming from

   2707     else if ( (nType==ControlType::Listbox) &&
   2708               ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
   2709     {
   2710         aEditRect = NWGetComboBoxButtonRect( nPart, rControlRegion );
   2711     }

#0  0x00007fffeb8d4c75 in GtkSalGraphics::getNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&, tools::Rectangle&, tools::Rectangle&) (this=0x555556825800, nType=ControlType::Listbox, nPart=ControlPart::ButtonDown, rControlRegion=..., rValue=..., rNativeBoundingRegion=..., rNativeContentRegion=...) at /home/julien/lo/libreoffice/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx:2770 #1  0x00007ffff0ee5891 in SalGraphics::GetNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, tools::Rectangle&, tools::Rectangle&, OutputDevice const*) (this=0x555556825800, nType=ControlType::Listbox, nPart=ControlPart::ButtonDown, rControlRegion=..., nState=ControlState::NONE, aValue=..., rNativeBoundingRegion=..., rNativeContentRegion=..., pOutDev=0x555556e10b20) at /home/julien/lo/libreoffice/vcl/source/gdi/salgdilayout.cxx:837 #2  0x00007ffff0c3c66c in OutputDevice::GetNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, tools::Rectangle&, tools::Rectangle&) const (this=0x555556e10b20, nType=ControlType::Listbox, nPart=ControlPart::ButtonDown, rControlRegion=..., nState=ControlState::NONE, aValue=..., rNativeBoundingRegion=..., rNativeContentRegion=...) at /home/julien/lo/libreoffice/vcl/source/outdev/nativecontrols.cxx:337 #3  0x00007ffff0b47897 in ListBox::Resize() (this=0x555556e10b20) at /home/julien/lo/libreoffice/vcl/source/control/listbox.cxx:586

This seems to help:

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 9f2cf0ea08ba..06fc4f3b0aaf 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2707,7 +2707,8 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
     else if ( (nType==ControlType::Listbox) &&
               ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
     {
-        aEditRect = NWGetComboBoxButtonRect( nPart, rControlRegion );
+        tools::Rectangle aControlRegion(GetWidgetSize(rControlRegion, gListBox));
+        aEditRect = NWGetComboBoxButtonRect( nPart, aControlRegion );
     }
     else if (nType == ControlType::Editbox && nPart == ControlPart::Entire)
     {

I tried to mimic Spinbox mechanism some lines above but perhaps I'm completely wrong.

Any thoughts?

Julien


cppunittester: /home/julien/lo/libreoffice/include/tools/gen.hxx:200: void Size::setWidth(long 
int): Assertion `(nWidth >= 0 || nWidth == -1) && "Wrong value for width"' failed.

---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) bt
#0  0x00007ffff78faf3b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff78fc2f1 in __GI_abort () at abort.c:79
#2  0x00007ffff78f3a8a in __assert_fail_base (fmt=0x7ffff7a47ec8 "%s%s%s:%u: %s%sAssertion `%s' 
failed.\n%n", assertion=assertion@entry=0x7ffff1358e20 "(nWidth >= 0 || nWidth == -1) && \"Wrong 
value for width\"", file=file@entry=0x7ffff1358de8 
"/home/julien/lo/libreoffice/include/tools/gen.hxx", line=line@entry=200, 
function=function@entry=0x7ffff135bef0 <Size::setWidth(long)::__PRETTY_FUNCTION__> "void 
Size::setWidth(long int)") at assert.c:92
#3  0x00007ffff78f3b02 in __GI___assert_fail (assertion=0x7ffff1358e20 "(nWidth >= 0 || nWidth == 
-1) && \"Wrong value for width\"", file=0x7ffff1358de8 
"/home/julien/lo/libreoffice/include/tools/gen.hxx", line=200, function=0x7ffff135bef0 
<Size::setWidth(long)::__PRETTY_FUNCTION__> "void Size::setWidth(long int)") at assert.c:101
#4  0x00007ffff08a2d3d in Size::setWidth(long) (this=0x7ffffffeccc0, nWidth=-32) at 
/home/julien/lo/libreoffice/include/tools/gen.hxx:200
#5  0x00007ffff0b4795f in ListBox::Resize() (this=0x555556ed6e80) at 
/home/julien/lo/libreoffice/vcl/source/control/listbox.cxx:595
#6  0x00007ffff09806f8 in vcl::Window::ImplCallResize() (this=0x555556ed6e80) at 
/home/julien/lo/libreoffice/vcl/source/window/event.cxx:521
#7  0x00007ffff0aa7570 in vcl::Window::Show(bool, ShowFlags) (this=0x555556ed6e80, bVisible=true, 
nFlags=ShowFlags::NONE)
    at /home/julien/lo/libreoffice/vcl/source/window/window.cxx:2262
#8  0x00007ffff0a93358 in vcl::Window::set_property(rtl::OString const&, rtl::OUString const&) 
(this=0x555556ed6e80, rKey="visible", rValue="True")
    at /home/julien/lo/libreoffice/vcl/source/window/window2.cxx:1420
#9  0x00007ffff0b4b65f in ListBox::set_property(rtl::OString const&, rtl::OUString const&) 
(this=0x555556ed6e80, rKey="visible", rValue="True")
    at /home/julien/lo/libreoffice/vcl/source/control/listbox.cxx:1438
#10 0x00007ffff08ca312 in BuilderUtils::set_properties(vcl::Window*, 
std::__debug::map<rtl::OString, rtl::OUString, std::less<rtl::OString>, 
std::allocator<std::pair<rtl::OString const, rtl::OUString> > > const&) (pWindow=0x555556ed6e80, 
rProps=std::__debug::map with 3 elements = {...})
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:2127
#11 0x00007ffff08cc3dc in VclBuilder::insertObject(vcl::Window*, rtl::OString const&, rtl::OString 
const&, std::__debug::map<rtl::OString, rtl::OUString, std::less<rtl::OString>, 
std::allocator<std::pair<rtl::OString const, rtl::OUString> > >&, std::__debug::map<rtl::OString, 
rtl::OUString, std::less<rtl::OString>, std::allocator<std::pair<rtl::OString const, rtl::OUString> 
&, std::__debug::map<rtl::OString, rtl::OUString, std::less<rtl::OString>, 
std::allocator<std::pair<rtl::OString const, rtl::OUString> > >&) (this=0x555556ed25d0, 
pParent=0x555556ed4540, rClass="GtkComboBoxText", rID="orientation", rProps=std::__debug::map with 
3 elements = {...}, rPango=std::__debug::map with 0 elements, rAtk=std::__debug::map with 0 
elements) at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:2405
#12 0x00007ffff08d1175 in VclBuilder::handleObject(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed4540, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:3481
#13 0x00007ffff08cd1e8 in VclBuilder::handleChild(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed4540, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:2608
#14 0x00007ffff08d0c46 in VclBuilder::handleObject(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed1100, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:3420
#15 0x00007ffff08cd1e8 in VclBuilder::handleChild(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed1100, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:2608
#16 0x00007ffff08d0c46 in VclBuilder::handleObject(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed1100, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:3420
#17 0x00007ffff08cd1e8 in VclBuilder::handleChild(vcl::Window*, xmlreader::XmlReader&) 
(this=0x555556ed25d0, pParent=0x555556ed1100, reader=...)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:2608
#18 0x00007ffff08bcd2a in VclBuilder::VclBuilder(vcl::Window*, rtl::OUString const&, rtl::OUString 
const&, rtl::OString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, 
bool) (this=0x555556ed25d0, pParent=0x555556ed1100, 
sUIDir="file:///home/julien/lo/libreoffice/instdir/share/config/soffice.cfg/", 
sUIFile="modules/simpress/ui/sidebarslidebackground.ui", sID="SlideBackgroundPanel", 
rFrame=uno::Reference to ((anonymous namespace)::Frame *) 0x5555569ac940, bLegacy=true)
    at /home/julien/lo/libreoffice/vcl/source/window/builder.cxx:416
#19 0x00007fffe37086a0 in PanelLayout::PanelLayout(vcl::Window*, rtl::OString const&, rtl::OUString 
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (this=0x555556ed1100, 
__vtt_parm=0x7fffdfc155c0 <VTT for sd::sidebar::SlideBackground+8>, pParent=0x555556eccfc0, 
rID="SlideBackgroundPanel", rUIXMLDescription="modules/simpress/ui/sidebarslidebackground.ui", 
rFrame=uno::Reference to ((anonymous namespace)::Frame *) 0x5555569ac940, __in_chrg=<optimized out>)
---Type <return> to continue, or q <return> to quit---
   e/sidebar/PanelLayout.cxx:29
#20 0x00007fffdf34e2ab in sd::sidebar::SlideBackground::SlideBackground(vcl::Window*, 
sd::ViewShellBase&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, 
SfxBindings*) (this=0x555556ed1100, pParent=0x555556eccfc0, rBase=..., rxFrame=uno::Reference to 
((anonymous namespace)::Frame *) 0x5555569ac940, pBindings=
    0x555556b98e40, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at 
/home/julien/lo/libreoffice/sd/source/ui/sidebar/SlideBackground.cxx:134
#21 0x00007fffdf33e372 in VclPtr<sd::sidebar::SlideBackground>::Create<VclPtr<vcl::Window>&, 
sd::ViewShellBase&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, 
SfxBindings*&>(VclPtr<vcl::Window>&, sd::ViewShellBase&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, SfxBindings*&) (arg#0=..., 
arg#1=..., arg#2=uno::Reference to ((anonymous namespace)::Frame *) 0x5555569ac940, 
arg#3=@0x7ffffffeeca0: 0x555556b98e40) at /home/julien/lo/libreoffice/include/vcl/vclptr.hxx:135
#22 0x00007fffdf33c7fc in sd::sidebar::PanelFactory::createUIElement(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x555556ed0c60, 
rsUIElementResourceURL="private:resource/toolpanel/SdPanelFactory/SlideBackgroundPanel", 
rArguments=uno::Sequence of length 9 = {...})
    at /home/julien/lo/libreoffice/sd/source/ui/sidebar/PanelFactory.cxx:127
#23 0x00007fffe42ec741 in (anonymous 
namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x5555569b80d0, 
ResourceURL="private:resource/toolpanel/SdPanelFactory/SlideBackgroundPanel", Args=uno::Sequence of 
length 9 = {...})
    at /home/julien/lo/libreoffice/framework/source/uifactory/uielementfactorymanager.cxx:441
#24 0x00007fffe704afcc in 
sfx2::sidebar::SidebarController::CreateUIElement(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer>
 const&, rtl::OUString const&, bool, sfx2::sidebar::Context const&) (this=0x555556d52340, rxWindow=
    uno::Reference to (VCLXContainer *) 0x555556ecfd88, 
rsImplementationURL="private:resource/toolpanel/SdPanelFactory/SlideBackgroundPanel", 
bWantsCanvas=false, rContext=...)
    at /home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:896
#25 0x00007fffe704a9d9 in sfx2::sidebar::SidebarController::CreatePanel(rtl::OUString const&, 
vcl::Window*, bool, sfx2::sidebar::Context const&, VclPtr<sfx2::sidebar::Deck> const&) 
(this=0x555556d52340, rsPanelId="SlideBackgroundPanel", pParentWindow=0x555556eca960, 
bIsInitiallyExpanded=true, rContext=..., pDeck=...)
    at /home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:841
#26 0x00007fffe7049e1a in sfx2::sidebar::SidebarController::CreatePanels(rtl::OUString const&, 
sfx2::sidebar::Context const&) (this=0x555556d52340, rDeckId="PropertyDeck", rContext=...) at 
/home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:672
#27 0x00007fffe7049ac0 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, 
sfx2::sidebar::Context const&, bool) (this=0x555556d52340, rDeckId="PropertyDeck", rContext=..., 
bForceCreate=false) at /home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:619
#28 0x00007fffe704a310 in 
sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, 
sfx2::sidebar::Context const&) (this=0x555556d52340, rDeckDescriptor=..., rContext=...) at 
/home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:750
#29 0x00007fffe7049304 in sfx2::sidebar::SidebarController::UpdateConfigurations() 
(this=0x555556d52340)
    at /home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:516
#30 0x00007fffe70484ab in 
sfx2::sidebar::SidebarController::notifyContextChangeEvent(com::sun::star::ui::ContextChangeEventObject
 const&) (this=0x555556d52340, rEvent=...)
    at /home/julien/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:289
#31 0x00007fffe4187531 in (anonymous 
namespace)::ContextChangeEventMultiplexer::BroadcastEventToSingleContainer(com::sun::star::ui::ContextChangeEventObject
 const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) 
(this=0x555556e1d100, rEventObject=..., rxEventFocus=uno::Reference to (sd::DrawController *) 
0x555556ba3848)
    at /home/julien/lo/libreoffice/framework/source/services/ContextChangeEventMultiplexer.cxx:258
#32 0x00007fffe41873a0 in (anonymous 
namespace)::ContextChangeEventMultiplexer::broadcastContextChangeEvent(com::sun::star::ui::ContextChangeEventObject
 const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) 
(this=0x555556e1d100, rEventObject=..., rxEventFocus=uno::Reference to (sd::DrawController *) 
0x555556ba3848)
    at /home/julien/lo/libreoffice/framework/source/services/ContextChangeEventMultiplexer.cxx:241
#33 0x00007fffe36f9e10 in 
ContextChangeEventMultiplexer::NotifyContextChange(com::sun::star::uno::Reference<com::sun::star::frame::XController>
 const&, vcl::EnumContext::Context) (rxController=uno::Reference to (sd::DrawController *) 
0x555556ba3848, eContext=vcl::EnumContext::Context::DrawPage)
    at /home/julien/lo/libreoffice/svx/source/sidebar/ContextChangeEventMultiplexer.cxx:58
#34 0x00007fffe36f9f46 in ContextChangeEventMultiplexer::NotifyContextChange(SfxViewShell*, 
vcl::EnumContext::Context) (pViewShell=0x555556ba2080, 
eContext=vcl::EnumContext::Context::DrawPage) at 
/home/julien/lo/libreoffice/svx/source/sidebar/ContextChangeEventMultiplexer.cxx:68
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) frame 5
#5  0x00007ffff0b4795f in ListBox::Resize (this=0x555556ed6e80) at 
/home/julien/lo/libreoffice/vcl/source/control/listbox.cxx:595
595                 aOutSz.setWidth( aContent.Left() );
(gdb) p aContent
$1 = {static RECT_EMPTY = -32767, nLeft = -32, nTop = 0, nRight = -1, nBottom = -32767}
(gdb) p aPoint.X()
[Thread 0x7fffe90e7700 (LWP 8267) exited]
$2 = 0
(gdb) p aPoint.Y()
$3 = 0
(gdb) p aPoint
$4 = Point = {x = 0, y = 0}
(gdb) p nBottom
$5 = 0
(gdb) p aOutSz
$6 = Size = {width = 0, height = 0}
(gdb) p aArea
$7 = {static RECT_EMPTY = -32767, nLeft = 0, nTop = 0, nRight = -32767, nBottom = -32767}
(gdb) p aPoint
$8 = Point = {x = 0, y = 0}


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.