Bug 159879 - Crash when closing "3D View" dialog
Summary: Crash when closing "3D View" dialog
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:24.8.0 target:24.2.2
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2024-02-25 17:08 UTC by Regina Henschel
Modified: 2024-03-07 15:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["signature/vcl::Window::Invalidate(InvalidateFlags)"]


Attachments
Document with 3D bar chart to reproduce the crash (169.55 KB, application/vnd.oasis.opendocument.calc)
2024-02-25 17:08 UTC, Regina Henschel
Details
bt with gen rendering (12.54 KB, text/plain)
2024-02-25 17:59 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2024-02-25 17:08:59 UTC
Created attachment 192760 [details]
Document with 3D bar chart to reproduce the crash

Open attached document and bring chart into edit mode.
Select the data series.
Open "3D View" dialog.
Change something, e.g. disable "right-angles axis".
Click OK => Crash.

I see the crash in Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 39048e0c0e9af455197ff57cc2947f8fb23e8542
CPU threads: 32; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded
Comment 1 Julien Nabet 2024-02-25 17:59:41 UTC
Created attachment 192761 [details]
bt with gen rendering

On pc Debian x86-64 with master sources updated today, I could reproduce this with gen and kf5 renderings but not with gtk3.
Comment 2 Julien Nabet 2024-02-25 20:17:26 UTC
I noticed that this line on gtk3 always returned false:
if(pPaintWindow->OutputToWindow())

Taking a look at SdrPaintWindow ctr, I see:
247  mbOutputToWindow(OUTDEV_WINDOW == mpOutputDevice->GetOutDevType())
(see https://opengrok.libreoffice.org/xref/core/svx/source/svdraw/sdrpaintwindow.cxx?r=9a71ac68#247)

With gtk3, it's OUTDEV_VIRDEV, that's why pPaintWindow->OutputToWindow() returns false and so we don't call InvalidateOneWin

On gdb, I changed the value to true just for the test and I could reproduce the crash too with gtk3.

Caolán: any idea here?
Comment 3 Caolán McNamara 2024-03-02 21:28:15 UTC
I think the widget this draws to gets destroyed before it does, and that's why this problem arises. Then for gtk its an intermediate VirtualDevice that we draw to, so the Invalidate issue doesn't arise, but the underlying dtor ordering still exists.

Simplest thing seem to be to basically just drop the problematic "pageview" at the start of the top dtor. https://gerrit.libreoffice.org/c/core/+/164295
Comment 4 Commit Notification 2024-03-03 13:50:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/217d918491398f68b826d7fa031d4cb84c1da8db

Resolves: tdf#159879 Crash when closing "3D View" dialog

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Caolán McNamara 2024-03-03 13:50:24 UTC
done in trunk, backport to 24.02 in gerrit
Comment 6 Commit Notification 2024-03-03 19:42:46 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/289772c27fd523df545262614fb31d90314326df

Resolves: tdf#159879 Crash when closing "3D View" dialog

It will be available in 24.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Julien Nabet 2024-03-03 19:58:53 UTC
On pc Debian x86-64 with master sources updated today (including Caolán's patch), I confirm I don't reproduce the crash anymore.
Thank you for the fix Caolán! :-)
Comment 8 Commit Notification 2024-03-06 15:50:37 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/22e97c90cb6334fd58bc856ab025291cb32b48d1

related: tdf#159879: test chart dialogs

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.