Bug 165487 - CRASH in SfxTabDialogController::ResetHdl(weld::Button &)
Summary: CRASH in SfxTabDialogController::ResetHdl(weld::Button &)
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: highest critical
Assignee: Samuel Mehrbrodt (allotropia)
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2025-02-27 12:13 UTC by Xisco Faulí
Modified: 2025-02-28 22:02 UTC (History)
6 users (show)

See Also:
Crash report or crash signature: ["SfxTabDialogController::ResetHdl(weld::Button &)"]


Attachments
empty dialog (17.30 KB, image/png)
2025-02-27 13:45 UTC, Xisco Faulí
Details
stack trace with symbols for crash on TabDialogController for the Page style dialog (51.09 KB, text/plain)
2025-02-27 15:12 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2025-02-27 12:13:31 UTC
Steps to reproduce:
1. Open Writer
2. Format - Page Style
3. Reset

-> Crash

Reproduced in

Version: 25.2.1.2 (X86_64) / LibreOffice Community
Build ID: d3abf4aee5fd705e4a92bba33a32f40bc4e56f49
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2025-02-27 12:24:02 UTC
Reproduced in

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 19df53668c2078015e7135aaca261093f5c4dc0a
CPU threads: 16; OS: Windows 10 X86_64 (build 9600); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded
Comment 2 Xisco Faulí 2025-02-27 13:44:21 UTC
Steps to reproduce:
1. Clean the user profile
2. Launch Writer with SAL_USE_VCLPLUGIN=gen instdir/program/swriter
3. Format - Page Style -> The dialog is empty
4. Reset

-> Crash
Comment 3 Xisco Faulí 2025-02-27 13:45:12 UTC
Regression introduced by:

commit e5e9ed7b87072c3c6366f50127cf2b9cf6bf4499	[log]
author	Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>	Fri Apr 26 15:01:22 2024 +0200
committer	Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>	Mon May 06 14:03:46 2024 +0200
tree 7a975214b10d6f65a5d451191d6e8ad4b392ddf7
parent 7d6e751faa545552de7859cd6530926676caf09f [diff]

tdf#99528 Use vertical tabs in page dialog

Bisected with: linux64-24.8
Comment 4 Xisco Faulí 2025-02-27 13:45:26 UTC
Created attachment 199507 [details]
empty dialog
Comment 5 Xisco Faulí 2025-02-27 13:47:19 UTC Comment hidden (obsolete)
Comment 6 Xisco Faulí 2025-02-27 15:11:03 UTC
So basically the problem is that when clicking Reset, the dialog doesn't have any id and it crashes. 
One way of setting the id is in https://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/styledlg.cxx?r=ca5c9591ba38ad83415a2d4ced98bfc74d30b032#50, however there might be another mechanism in place to do so because with horizontal tabs it works correctly.
@Caolán, Do you have any idea why the id is not set with vertical tabs ? Should be done in the .ui file ?
Comment 7 V Stuart Foote 2025-02-27 15:12:38 UTC
Created attachment 199515 [details]
stack trace with symbols for crash on TabDialogController for the Page style dialog

Attached windbg stack trace with symbols for crash on Windows build of 25.2.1.2

00 00000009`f0f8e220 00007fff`cc72a41d     mergedlo!SfxTabDialogController::ResetHdl(class weld::Button * __formal = 0x00000120`49830e70)+0xae [C:\cygwin64\home\buildslave\source\libo-core\sfx2\source\dialog\tabdlg.cxx @ 424] 


=-testing-=
Version: 25.2.1.2 (X86_64) / LibreOffice Community
Build ID: d3abf4aee5fd705e4a92bba33a32f40bc4e56f49
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 8 Heiko Tietze 2025-02-27 18:12:42 UTC
No crash for

Version: 25.2.0.3 (X86_64) / LibreOffice Community
Build ID: 520(Build:3)
CPU threads: 32; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
25.2.0-4
Calc: threaded

but happens on 

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3aa4d993063a3f871f8f509ba81274a356d0dda0
CPU threads: 32; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded

(master opens with an empty tab while fresh has something activated)
Comment 9 Xisco Faulí 2025-02-27 19:07:13 UTC
at least on linux I have to use GEN, not reproducible with GTK3. Note: it's important to clean the profile each time
Comment 10 Caolán McNamara 2025-02-28 14:21:14 UTC
I imagine this is a flaw/difference between TabControl and VerticalTabControl

see:

TabControl::GetCurPageId

vs

VerticalTabControl::GetCurPageId

looks to me that if no specific page is set as the current one then TabControl will report back the first page and all is well, while VerticalTabControl claims nothing is selected and you get this weirdness.

Someone needs to compare how they work a little closer, and maybe one solution is that VerticalTabControl::GetCurPageId returns the pageid of page 0 if nothing else is set yet and there is a page 0

sfx2/source/dialog/tabdlg.cxx:537 looks like the first place there is a warning about the problem
Comment 11 Commit Notification 2025-02-28 22:02:30 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a91494780bb59afe8c971003e6b809f1e66df050

tdf#165487 Always select a tab page by default

It will be available in 25.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.