diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-06-04 08:54:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-06-04 09:58:09 +0200 |
commit | ec5aa7e88b0d412041f8575111f0da295065cecb (patch) | |
tree | 89750406f0801bf17d653d629785a6fe3904ba91 /svtools | |
parent | 4078428a401f4a99045451b59863d6001cdcc20b (diff) |
svtools: fix crash in BrowseBox::GetControlArea()
UITest_writer_tests4 sometimes (but not always) crashes for me,
typically not when it's execute alone, but when it's executed as part of
'make check'. The soffice process crashes on shutdown, after all tests
passed without problems.
coredumpctl gives this in gdb:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 BrowseBox::GetControlArea (this=0x9bd3f90) at svtools/source/brwbox/brwbox1.cxx:2137
2137 auto nHeight = aHScroll->GetSizePixel().Height();
(gdb) print aHScroll
$1 = {m_rInnerRef = empty rtl::Reference}
(gdb) bt
#0 BrowseBox::GetControlArea() const (this=0x9bd3f90) at svtools/source/brwbox/brwbox1.cxx:2137
#1 0x00007fbbd2022ed9 in DbGridControl::RearrangeHdl(Timer*) (this=0x9bd3f90) at svx/source/fmcomp/gridctrl.cxx:2646
#2 0x00007fbbd2022ea3 in DbGridControl::LinkStubRearrangeHdl(void*, Timer*) (instance=0x9bd3f90, data=0x9bd4468) at svx/source/fmcomp/gridctrl.cxx:2643
#3 0x00007fbbcedb8d79 in Link<Timer*, void>::Call(Timer*) const (this=0x9bd4488, data=0x9bd4468) at include/tools/link.hxx:111
#4 0x00007fbbcedb8c01 in Timer::Invoke() (this=0x9bd4468) at vcl/source/app/timer.cxx:75
Let's assume the problem is that somehow we can get here after the
VclPtr is already disposed and just return early to avoid the crash.
Change-Id: Ic27727dc3622d8da88256c80f873dc79795864b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168393
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 982e00cfd388..0457d768ec98 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -2134,6 +2134,11 @@ bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth) tools::Rectangle BrowseBox::GetControlArea() const { + if (!aHScroll) + { + return tools::Rectangle(); + } + auto nHeight = aHScroll->GetSizePixel().Height(); auto nEndRight = aHScroll->GetPosPixel().X(); |