Bug 148146 - Selecting an Impress template results in failed assert
Summary: Selecting an Impress template results in failed assert
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-23 07:30 UTC by Michael Weghorn (away)
Modified: 2022-03-24 06:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn (away) 2022-03-23 07:30:38 UTC
Steps to reproduce:

0) use current LO master debug build
1) start Impress
2) in the "Select a Template" dialog, select "Beehive" (first element, probably the same with any other as well)

Note: It's possible to disable that this dialog is shown on startup. Use a fresh profile if it doesn't.

Result:

LibreOffice "crashes" due to a failed assert:

soffice.bin: /home/michi/development/git/libreoffice/svl/source/items/itemset.cxx:1256: SfxItemSet SfxItemSet::CloneAsValue(bool, SfxItemPool*) const: Assertion `(typeid(*this) == typeid(SfxItemSet)) && "cannot call this on a subclass of SfxItemSet"' failed.
Comment 1 Michael Weghorn (away) 2022-03-23 07:45:36 UTC
The assert was recently added in

commit fe2ec505786bacc6f3baca3292367903644ac99b
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date:   Fri Feb 18 10:56:56 2022 +0200

    improve the SfxItemSet::CloneAsValue check
    
    to prevent object slicing.
    
    Which reveals a problems with
        commit 044fa30a4c77013c87a7e2a6dd9022a2f6599778
        Author: Noel Grandin <noelgrandin@gmail.com>
        Date:   Thu Sep 23 18:44:42 2021 +0200
        no need to allocate this SfxItemSet on the heap
    and
        commit 044fa30a4c77013c87a7e2a6dd9022a2f6599778
        Author: Noel Grandin <noelgrandin@gmail.com>
        Date:   Thu Sep 23 18:44:42 2021 +0200
        no need to allocate this SfxItemSet on the heap
    so revert the problematic bits of those commits


Adding CC: to Noel Grandin
Comment 2 Commit Notification 2022-03-23 17:19:00 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8a967b566603225d2719735c0d27bf6c91a49bd2

tdf#148146 Selecting an Impress template results in failed assert

It will be available in 7.4.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 3 Michael Weghorn (away) 2022-03-24 06:19:13 UTC
Thanks! Fix verified with

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 40a327857695d45c80f94b3c73e6b3599f96dcc0
CPU threads: 12; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded