Bug 160427 - LibreLogo PICTURE SVG opens new window "untitled 1" and hangs LO.
Summary: LibreLogo PICTURE SVG opens new window "untitled 1" and hangs LO.
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.9.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.2.0 target:24.2.6 target:24...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-30 03:37 UTC by Roland Chee
Modified: 2024-07-15 08:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the Untitled window. (101.03 KB, image/png)
2024-04-15 14:25 UTC, Roland Chee
Details
LibreOffice 24.2.2 (40.68 KB, image/png)
2024-04-15 14:59 UTC, Roland Chee
Details
Reproducible document (10.89 KB, application/vnd.oasis.opendocument.text)
2024-07-10 10:07 UTC, Patrick (volunteer)
Details
Sample during hang using the Activity Monitor application (161.95 KB, text/plain)
2024-07-10 10:07 UTC, Patrick (volunteer)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Chee 2024-03-30 03:37:26 UTC
Steps to reproduce:
1. Enter the following in new Writer document:
"""
PICTURE "circle.svg" [ CIRCLE 50 ]
"""
2. Save as "circle.odt".
3. Run from LibreLogo toolbar.

Observed outcome:
1. Turtle draws circle and sits inside it.
2. The file "circle.svg" is produced correctly, and in the correct directory.
3. New window appears titled "Untitled 1" followed shortly by the Spinning Beach Ball of Death (SBBOD).
4. The mouse cursor changes to SBBOD on all LibreOffice windows ("circle.odt" and "Untitled 1"); and LibreOffice is marked "unresponsive" on Force Quit Applications dialog.

Tried with same outcome:
1. tick only "Use hardware acceleration". 
2. tick only "Use anti-aliasing".
3. tick only "Use Skia for all rendering".
4. tick none of above.

After force-quit Libreoffice; and file-recovery:
1. "circle.odt" is recovered fully and the turtle is not sitting in a circle.
2. "Untitled 1 (Remote)" is an empty document.
Comment 1 Dieter 2024-04-14 11:54:14 UTC
(In reply to Roland Chee from comment #0)
> Steps to reproduce:
> 1. Enter the following in new Writer document:
> """
> PICTURE "circle.svg" [ CIRCLE 50 ]
Attachment is missing. Please add it.
=> NEEDINFO
Comment 2 Dieter 2024-04-14 11:54:47 UTC
And please also text with a recent version of LO (LO 24.2.2). Thank you.
Comment 3 Roland Chee 2024-04-15 14:25:24 UTC
Created attachment 193687 [details]
Screenshot of the Untitled window.

Strangely, this time it is "Untitled 2", rather than "Untitled 1".
I was unable to re-size the window, because libreoffice is just totally frozen.
Comment 4 Roland Chee 2024-04-15 14:29:37 UTC
LibreOffice Community 7.5.9.2(x86_64)
CPU threads:4
MacOSX 11.7.10
UI render: default
VCL: osx
Locale: en_AU.UTF-8
UI: en-US
Comment 5 Roland Chee 2024-04-15 14:59:49 UTC
Created attachment 193689 [details]
LibreOffice 24.2.2

Similarly, LibreOffice 24.2.2 hangs after running the LibreLogo code.
Comment 6 Roland Chee 2024-04-15 15:06:08 UTC
The difference with LibreOffice 24.2.2 are:
1. The new window has no title.
2. After force-quit, then I re-open "circle.odt", there is no dialog about file recovery for "circle.odt", and no listing of any "untitled (remote)" file.
Comment 7 Robert Großkopf 2024-04-15 15:58:47 UTC
I have tried this in following way:
Activated Libre Logo toolbar.
Activated turtle and 2 page layout by the wand.
Wrote the following code for my German Linux system:

BILD "/home/robby/circle.svg" [
KREIS 50
]

Executed the code.
circle.svg will be created in my home directory.
Turtle sits inside the circle on the first page of LibreLogo layout.

Works also if I try to write direct to "circle.svg" without any path.

My system: OpenSUSE 15.6 64bit rpm Linux with LO 24.2.2.2
Comment 8 Roland Chee 2024-04-22 06:23:59 UTC
(In reply to Robert Großkopf from comment #7)
> I have tried this in following way:
> Activated Libre Logo toolbar.
> Activated turtle and 2 page layout by the wand.
> Wrote the following code for my German Linux system:
> 
> BILD "/home/robby/circle.svg" [
> KREIS 50
> ]
> 
> Executed the code.
> circle.svg will be created in my home directory.
> Turtle sits inside the circle on the first page of LibreLogo layout.
> 
> Works also if I try to write direct to "circle.svg" without any path.
> 
> My system: OpenSUSE 15.6 64bit rpm Linux with LO 24.2.2.2

Thank you for the attempt to reproduce this bug.
If no problem on Linux, maybe the problem is on MacOS?
I am on MacOS 11.7.10 (Big Sur). Same bug with LO 24.2.2 and LO 7.5.9.2.
Of interest, LO has produced the SVG image before LO hangs.
Maybe a script could not finish or close?
Comment 9 Patrick (volunteer) 2024-07-10 10:07:23 UTC
Created attachment 195199 [details]
Reproducible document
Comment 10 Patrick (volunteer) 2024-07-10 10:07:58 UTC
Created attachment 195200 [details]
Sample during hang using the Activity Monitor application
Comment 11 Patrick (volunteer) 2024-07-10 10:15:28 UTC
I can reproduce this bug in my local master build on macOS using attachment #195199 [details]. I also see a circle.svg file created immediately before the hang.

I took a sample of LibreOffice while it was hanging using the Activity Monitor application (see attachment #195200 [details]) and it looks like the LibreLogo thread is crashing since it calls std::terminate). Maybe an uncaught exception is being thrown?

I read through the code and see if I can figure out what is happening. I'll post again when I have any news.
Comment 12 Commit Notification 2024-07-10 16:39:31 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160427 native menu changes can only be done on the main thread

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 13 Patrick (volunteer) 2024-07-10 16:42:24 UTC
I have committed a fix this bug. The fix should be in tomorrow's (11 July 2024) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Note for macOS testers: the nightly master builds install in /Applications/LibreOfficeDev.app. These builds are not codesigned like regular LibreOffice releases so you will need to execute the following Terminal command after installation but before you launch /Applications/LibreOfficeDev:

xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app
Comment 14 Commit Notification 2024-07-11 08:59:51 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/2a7441a00155ce46977fbd0779590e12a5cfd944

tdf#160427 native menu changes can only be done on the main thread

It will be available in 24.2.6.

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 15 Roland Chee 2024-07-14 14:07:13 UTC
Yes! I tested [LibreOfficeDev_24.2.6.0.0_MacOS_x86-64.dmg](https://dev-builds.libreoffice.org/daily/libreoffice-24-2/MacOSX-x86_64@tb92-TDF/current/) by following the same steps in my initial post. 

LOdev did not freeze after producing "circle.svg". And there was no sight of any new untitled window. 

The bug is gone.

Thank you all for your help and especially to Patrick Luby for the fix!
Comment 16 Commit Notification 2024-07-15 08:32:23 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/6079df3e7f86270aad9d4a6ce811366f280fa762

tdf#160427 native menu changes can only be done on the main thread

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