Bug 159042 - crash after changing cell style (if some cells already have direct formatting)
Summary: crash after changing cell style (if some cells already have direct formatting)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Julien Nabet
URL:
Whiteboard: target:24.8.0 unitTestNotes:9
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Calc-Styles Crash
  Show dependency treegraph
 
Reported: 2024-01-05 21:40 UTC by Stéphane Guillou (stragu)
Modified: 2024-09-05 05:33 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
crash minidump (387.40 KB, application/vnd.tcpdump.pcap)
2024-01-05 21:40 UTC, Stéphane Guillou (stragu)
Details
bt with debug symbols (5.70 KB, text/plain)
2024-01-06 13:29 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2024-01-05 21:40:26 UTC
Created attachment 191783 [details]
crash minidump

Steps:
1. Open Calc
2. Select range of cells, apply some direct formatting (e.g. bold, or background colour)
3. Modify the Default cell style, for example: Background tab > Color > pick a colour, click OK (but could be borders, font effects...)

Result: crash

Does not crash without step 2.

Reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5056da285da2f130d741add1f8432cd590116a96
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Not reproduced in:

Version: 24.2.0.0.beta1 (X86_64) / LibreOffice Community
Build ID: 5f390384195b7264c6e52add9e90a39790285249
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Bibisected with linux-64-24.8 repo to first bad build [9fa2fe224b1f1414a513d87d6dc8eb26579f5b79] which points to:

commit 2e1f9da8a6359c8909e087a92239aefd4851b116
author	Armin Le Grand (allotropia) 	Sat Dec 23 15:52:06 2023 +0100
committer	Armin Le Grand 	Thu Dec 28 19:38:15 2023 +0100
Decouple ScPatternAttr from SfxItemPool
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161244

Can you please have a look, Armin?
Comment 1 Julien Nabet 2024-01-06 13:29:42 UTC
Created attachment 191786 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 2 Julien Nabet 2024-01-06 13:42:27 UTC
I gave a try with https://gerrit.libreoffice.org/c/core/+/161710
Comment 3 Commit Notification 2024-01-07 10:39:26 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#159042: crash after changing cell style (if direct formatting done)

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 4 Julien Nabet 2024-01-07 11:11:29 UTC
Stéphane: not sure if it's the right way to fix this but at least, there's no crash.
Comment 5 Stéphane Guillou (stragu) 2024-01-08 09:04:32 UTC
Thanks Julien, it doesn't crash anymore in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e83c7ec2f4d801365235bf56d7cc8cf31ef4a00e
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Maybe Armin can confirm this is the best way to go about it?
Comment 6 Armin Le Grand (allotropia) 2024-01-08 16:22:36 UTC
Confirmed, see comment in https://gerrit.libreoffice.org/c/core/+/161710
Thanks a lot!
Comment 7 Julien Nabet 2024-01-08 21:26:10 UTC
Thank you Armin and Stéphane! :-)
Comment 8 Stéphane Guillou (stragu) 2024-01-08 21:33:48 UTC
Thank you both!
Comment 9 Buovjaga 2024-09-05 05:33:12 UTC
Note for test writers: it seems difficult to undo this fix in order to exercise a test, patch: https://gerrit.libreoffice.org/c/core/+/172232