Bug 162593 - Gallery elements added to a custom theme may crash LibO and are only visible after restarting LibreOffice
Summary: Gallery elements added to a custom theme may crash LibO and are only visible ...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.2 target:24...
Keywords:
: 162565 163544 (view as bug list)
Depends on:
Blocks: Gallery
  Show dependency treegraph
 
Reported: 2024-08-23 12:12 UTC by Cor Nouws
Modified: 2024-11-11 12:19 UTC (History)
7 users (show)

See Also:
Crash report or crash signature: ["FilterEntry::~FilterEntry()"]


Attachments
gdb log file (37.32 KB, text/x-log)
2024-08-23 12:12 UTC, Cor Nouws
Details
Callstack by VS (4.28 KB, text/plain)
2024-08-25 23:57 UTC, Regina Henschel
Details
zip of the user-gallery folder that reliably crashes on my side (7.03 KB, application/zip)
2024-08-26 11:28 UTC, Cor Nouws
Details
Object to add to a custom theme (11.03 KB, application/vnd.oasis.opendocument.graphics)
2024-11-11 12:10 UTC, Callegar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2024-08-23 12:12:53 UTC
Created attachment 195981 [details]
gdb  log file

Issues with
-a- Adding Elements to custom Theme doesn't work
-b- Crash on opening Gallery after restart

One bug report, since I expect them to be related, since:

I made a fresh build after https://git.libreoffice.org/core/commit/0afb4cfc5ed1e926dfd287007c5a35585584daec (bug 162555)


1 - Added _TestTheme as gallery theme.
2 - Could 'add' elements via the UI (find files, add, ok)
  a. =>  But these were not visible.

3 - Closed and restarted, opened Impress.
  b. => Trying to open the Gallery reliably crashes.

Attaching a backtrace.log.

Also: removing /user/gallery and restarting makes the crashing disappear.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2c9821d391c243ae83a408163f054d7a7a9a1daa
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2024-08-23 13:31:09 UTC
I can reproduce a similar issue with

1. Open any component
2. Go to the sidebar in the Gallery
3. Click on NEW
4. Click on Cancel

-> Crash
Comment 2 Xisco Faulí 2024-08-23 13:32:15 UTC
Also reproduced in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b93c179b44e8b76e036e6fba560325c5cceb7103
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 10240); UI render:
Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2024-08-23 13:34:00 UTC
However i can't reproduce it in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4ac1015b58a676324443de54188c16abf28d642f
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: x11
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

nor in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 480281006ff9ea43fe6e9c357909ed55d0011c8f
CPU threads: 16; OS: Windows 8.1 X86_64 (6.3 build 9600); UI render: Skia/Raster; VCL: win
Locale: el-GR (en_GB); UI: en-US
Calc: threaded

using the bisect repositories...
Comment 4 Xisco Faulí 2024-08-23 13:37:19 UTC
*** Bug 162565 has been marked as a duplicate of this bug. ***
Comment 5 Cor Nouws 2024-08-23 13:57:40 UTC
(In reply to Xisco Faulí from comment #1)
> I can reproduce a similar issue with
> 
> 1. Open any component
> 2. Go to the sidebar in the Gallery
> 3. Click on NEW
> 4. Click on Cancel
> 
> -> Crash
That scenario doesn't crash for me.
Comment 6 Xisco Faulí 2024-08-23 14:11:04 UTC
@Cor, are you using a build from https://dev-builds.libreoffice.org/daily/master/ or your own build ?
Comment 7 Buovjaga 2024-08-23 15:02:37 UTC
Neither scenario crashes for me, non-debug build from this morning.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e1a4cdb3564c38ac1b75cc076c6762369e79137c
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 8 Buovjaga 2024-08-23 15:03:32 UTC
I did get the same "added objects not visible in theme", but after reopening Impress I could see the object I added.
Comment 9 Buovjaga 2024-08-23 15:47:10 UTC
No repro with a daily build either

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ea61bee5bcca7ad7cb05bc66fdf973c04b3d3396
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 10 Cor Nouws 2024-08-24 08:43:03 UTC
(In reply to Xisco Faulí from comment #6)
> @Cor, are you using a build from
> https://dev-builds.libreoffice.org/daily/master/ or your own build ?
Was a local build, with a fresh pull.
(will try a daily soon)
Comment 11 Cor Nouws 2024-08-25 20:23:35 UTC
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8843081f91e206b4749b83b186caaceaf1f8c4e3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Added '_TestTheme'
Added svg files
 => not visible

Closed LO with I think Gallery open in Impress.
Now every time I start an Impress file .. > crash
(4 or 5 reports just sent)

Crashing stops by renaming user/galley/ to user/gallery_BAK/
Comment 12 Mike Kaganski 2024-08-25 20:30:19 UTC
A blind attempt on *crash* is https://gerrit.libreoffice.org/c/core/+/172280
Comment 13 Mike Kaganski 2024-08-25 20:33:41 UTC
By the way: my suspicion is some *specific* file added to the gallery, which gives a failure at acquire time. And it would indeed be nice to find out the specific object that does that, and have a separate bug on that - but crash itself is not nice, so my fix avoids the crash here (but the problematic object will likely still be not shown / processed).
Comment 14 Regina Henschel 2024-08-25 23:57:52 UTC
Created attachment 196016 [details]
Callstack by VS

Start a new text document. Draw a "Star"-shape, for example. Drag it to a custom theme in the Gallery. In a debug build, I get a failed assertion, see attached call stack.
Comment 15 Commit Notification 2024-08-26 04:22:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162593: blind crash fix

It will be available in 25.2.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 16 Mike Kaganski 2024-08-26 04:37:24 UTC
(In reply to Cor Nouws from comment #0)
> Issues with
> -a- Adding Elements to custom Theme doesn't work
> -b- Crash on opening Gallery after restart

(In reply to Regina Henschel from comment #14)
> Start a new text document. Draw a "Star"-shape, for example. Drag it to a
> custom theme in the Gallery. In a debug build, I get a failed assertion, see
> attached call stack.

Wow, wow, wow! :-D Wait a second!

If Cor and Regina were newbies, I would write something like

> Dear Cor, dear Regina! Please note that the rule is to have a single bug per issue.
> So please file anything except the crash after the reload as separate bug reports.
> Thank you!

But in this case, I actually don't know what to tell, so let me write this:

Dear Cor, dear Regina! Please note that the rule is to have a single bug per issue.
So please file anything except the crash after the reload as separate bug reports.
Thank you!

And Cor, could you please test if the crash-after-reload itself is fixed by the commit in comment 15. Thanks!
Comment 17 Cor Nouws 2024-08-26 08:18:09 UTC
(In reply to Mike Kaganski from comment #16)
> Dear Cor, dear Regina! 
> ..
:)

> And Cor, could you please test if the crash-after-reload itself is fixed by
> the commit in comment 15. Thanks!
With pleasure, dear Mike.

For now, I tested if some specific image file caused the issue. Couldn't find it.
What I did notice: some x-sequence of closing/changing status of Sidebar/Gallery, apparently completes some initiation work, with as result that there is no crash, also not if in a later run of LO, I add an image to the gallery theme, close LO directly and restart (which does cause the 1st crash).
Comment 18 Xisco Faulí 2024-08-26 10:00:15 UTC
(In reply to Mike Kaganski from comment #12)
> A blind attempt on *crash* is https://gerrit.libreoffice.org/c/core/+/172280

Triggered a new daily build -> https://ci.libreoffice.org/job/lo_daily_tb_win/1861/ once it's ready I'll test it as well
Comment 19 Cor Nouws 2024-08-26 11:28:27 UTC
Created attachment 196028 [details]
zip of the user-gallery folder that reliably crashes on my side

(In reply to Cor Nouws from comment #17)
> What I did notice: some x-sequence of closing/changing status of
> Sidebar/Gallery, apparently completes some initiation work, with as result
> that there is no crash, also not if in a later run of LO, I add an image to
> the gallery theme, close LO directly and restart (which does cause the 1st
> crash).
So attached a folder that does crash..
Reproducing the situation as such, is difficult.
Comment 20 Xisco Faulí 2024-08-26 14:49:15 UTC
(In reply to Xisco Faulí from comment #18)
> (In reply to Mike Kaganski from comment #12)
> > A blind attempt on *crash* is https://gerrit.libreoffice.org/c/core/+/172280
> 
> Triggered a new daily build ->
> https://ci.libreoffice.org/job/lo_daily_tb_win/1861/ once it's ready I'll
> test it as well

Still reproducible in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6ea40d129e53c676970d3c0ca1db561394422419
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 10240); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 21 Commit Notification 2024-09-07 21:19:04 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/091f927d74cff4813c477e842b6658f93623bbb2

tdf#162593: blind crash fix

It will be available in 24.8.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 22 Commit Notification 2024-09-08 19:35:42 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-1":

https://git.libreoffice.org/core/commit/9b16eb9b44214852709f32c849ce415bc1f71e1d

tdf#162593: blind crash fix

It will be available in 24.8.1.

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 23 jwogeiger 2024-10-09 07:14:19 UTC
Bug persistent.
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 20; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Comment 24 Xisco Faulí 2024-10-17 18:40:00 UTC
Hi Cor,
is this issue still reproducible for you?
The problem I described in comment 1 is reported in bug 161606
Comment 25 m_a_riosv 2024-10-20 21:46:30 UTC
*** Bug 163544 has been marked as a duplicate of this bug. ***
Comment 26 Callegar 2024-10-20 22:02:33 UTC
Objects cannot be dragged to any custom theme without crashing LibO.
Seen in Linux KF6 with 24.8.2.1.
Obvious workaround is to use 24.2.x to manipulate the gallery themes and just use them with 24.8.2.
Comment 27 Cor Nouws 2024-10-23 20:01:45 UTC
(In reply to Xisco Faulí from comment #24)
> Hi Cor,
> is this issue still reproducible for you?
Hi Xisco,

Partly it is solved.
- Create new theme (still fine)
- Add files via theme properties dialog
  > these do not show up as elements
- closing and restarting LibreOffice
  > elements added are visible now.

Similar with dragging an object to the theme in the Gallery pane:
these are visible only after closing and restarting LibreOffice.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cf912b08e4a22f66ab1ec5fa601ba3e50e3c4cc
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 28 Cor Nouws 2024-10-23 20:05:09 UTC
Since the crash is fixed and I was so stupid to create a report with this as summary:
  "Crash & other issue with Gallery (after attempt to add elements to a custom theme) "  (apologies ..)
let me correct that to:
  "Gallery elements added to a custom theme are only visible after restarting LibreOffice"
Comment 29 Cor Nouws 2024-10-23 20:10:06 UTC
@mike,
from the comments in bug 161606 I could not understand if your blind fix mentioned here or some other patch fixed the reported crash( or crashes)
Comment 30 Callegar 2024-10-23 20:19:11 UTC
Unclear where the fix for the crash is applied. From the comments, I guess it should be in 24.8.2.1, but 24.8.2.1 crashes for me when dragging objects into a custom theme. Going back to LibO "still", the crash does not happen. So this looks like a regression from 24.2 to 24.8. Is there something to test in the 24.8 branch that should fix the crash?
Comment 31 Xisco Faulí 2024-10-23 20:30:31 UTC
Hi Cor,
could you please try with a more recent daily build including b83094d1198ae59ef7736fb3bbce5448459370e9 ?
Comment 32 Cor Nouws 2024-10-26 20:41:22 UTC
(In reply to Xisco Faulí from comment #31)
> Hi Cor,
> could you please try with a more recent daily build including
> b83094d1198ae59ef7736fb3bbce5448459370e9 ?
Hi Xisco,

Same as in comment 27 
With  Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3a8278c42e14b03eb57987adf33b6d61bfb3f856
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
...
Comment 33 Callegar 2024-11-11 12:10:59 UTC
Created attachment 197542 [details]
Object to add to a custom theme
Comment 34 Callegar 2024-11-11 12:19:21 UTC
Tested again with LibO 24.8.3.2 (build from libreoffice-dev RPMs, on arch via the libreoffice-dev-bin aur pkg). This should guarantee that what I am observing is not a side effect of my distro build.

The problem persists in LibO 24.8.3.2, which is nasty because the gallery is an important functionality and the issue has reached almost half of the cycle of LibO 24.8.

This is troublesome because the problem is actually more serious than originally indicated.

It is not just a matter of visibility of the items added to custom gallery themes that is only achieved after LibO is restarted. This indeed would be an issue with a simple (even if a bit bothersome) workaround: restart LibO.

The problem is that adding an item to a custom gallery theme often **crashes** LibO altogether. When this happens, the item is not retained in the theme as LibO is restarted. In other words, in many cases it is simply *impossible* to add an item to a custom gallery theme.

In addition to that, LibO is often also crashed by deleting objects from custom themes. Finally, once LibO is crashed when adding/removing objects from a theme, the theme appears to remain "corrupted": trying to re-add the object to the theme invariably results in a crash.

For instance, consider the test drawing libo-test.odg (Object to add to a custom theme) that I am attaching and that contains a single object. Try the following:

1. start LibO draw and open the file.
2. make a new custom theme (e.g. "My theme 2")
3. drag the object to this new theme.

What I see is that LibO does not crash, but you need to restart LibO to make the object visible in the theme.

4. restart LibO draw with a new drawing
5. pick the object from "My theme 2" and put it in the drawing
6. edit the object (enter group, add a line, exit group)
7. drag the new object to "My theme 2"

LibO crashes. You cannot add the object.

8. restart LibO draw once more
9. see that the new object is in fact not present in "My theme 2"
10. try to delete the first object from "My theme 2"

LibO crashes.

11. restart LibO draw and open the initial test file.
12. drag the object to "My theme 2"

LibO crashes.

If possible I would like to strongly advocate that, if possible, all the changes concerning the gallery introduced in LibO 24.8 wrt LibO 24.2 are reverted until they can be reworked to be correct.