diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2020-11-08 09:15:25 -0500 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-04-29 10:49:24 +0200 |
commit | 4e3186e82891c8a8108a45d31dea2a32472a2733 (patch) | |
tree | 0e49f3fca80a50690a16c39ce70a97206afe7e35 | |
parent | Better handling of filelocs (diff) | |
download | core-4e3186e82891c8a8108a45d31dea2a32472a2733.tar.gz core-4e3186e82891c8a8108a45d31dea2a32472a2733.zip |
vcl: lok: don't use window impl after destroy
When destroying floating windows, accessing the GetLOKNotifier
can segfault. The following is the stack-trace from such
a case.
/usr/bin/loolforkit(_ZN7SigUtil13dumpBacktraceEv+0x5e)[0x55cbf9da62fe]
/usr/bin/loolforkit(+0x1d0af5)[0x55cbf9da6af5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7fe0a125f8a0]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZNK3vcl6Window14GetLOKNotifierEv+0x7)[0x7fe09e67b827]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN3vcl6Window24GetParentWithLOKNotifierEv+0x2b)[0x7fe09e67b86b]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14FloatingWindow12StateChangedE16StateChangedType+0x43)[0x7fe09e609a13]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN3vcl6Window4ShowEb9ShowFlags+0x2ba)[0x7fe09e67cd5a]
/opt/collaboraoffice6.4/program/libmergedlo.so(_Z21ImplDestroyHelpWindowR14ImplSVHelpDatab+0xe3)[0x7fe09e90c193]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN9Scheduler21ProcessTaskSchedulingEv+0x8ea)[0x7fe09e93817a]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14SvpSalInstance12CheckTimeoutEb+0x107)[0x7fe09ea06807]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14SvpSalInstance7DoYieldEbb+0x85)[0x7fe09ea06905]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x2f5d6fb)[0x7fe09e94f6fb]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN11Application7ExecuteEv+0x45)[0x7fe09e950295]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x1f6d545)[0x7fe09d95f545]
/opt/collaboraoffice6.4/program/libmergedlo.so(_Z10ImplSVMainv+0x51)[0x7fe09e957321]
/opt/collaboraoffice6.4/program/libmergedlo.so(soffice_main+0x98)[0x7fe09d980b88]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x1f9e7c1)[0x7fe09d9907c1]
/usr/bin/loolforkit(_Z10lokit_mainRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_S6_S6_S6_bbbbm+0x2562)[0x55cbf9d4c792]
/usr/bin/loolforkit(+0x15fc77)[0x55cbf9d35c77]
/usr/bin/loolforkit(_Z18forkLibreOfficeKitRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_S6_S6_i+0xb44)[0x55cbf9d36b24]
/usr/bin/loolforkit(main+0x18a7)[0x55cbf9d00e17]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fe0a0e7db97]
/usr/bin/loolforkit(_start+0x2a)[0x55cbf9d07efa]
Change-Id: Ia467d51896d1ac657bde5ae2803fcb2557ebd3fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105445
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 5a3837034960327743154887732c4cae04cfc971)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114727
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | vcl/source/window/window.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 10638fa43957..bf270d6f2ffb 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3236,12 +3236,12 @@ void Window::ReleaseLOKNotifier() const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const { - return mpWindowImpl->mpLOKNotifier; + return mpWindowImpl ? mpWindowImpl->mpLOKNotifier : nullptr; } vcl::LOKWindowId Window::GetLOKWindowId() const { - return mpWindowImpl->mnLOKWindowId; + return mpWindowImpl ? mpWindowImpl->mnLOKWindowId : 0; } VclPtr<vcl::Window> Window::GetParentWithLOKNotifier() |