Bug 155917 - Writer crashes when inserting ODT file containing PDF into table in another ODT doc
Summary: Writer crashes when inserting ODT file containing PDF into table in another O...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.1.2 release
Hardware: x86-64 (AMD64) All
: high critical
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:24.8.0
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Insert-File-Content
  Show dependency treegraph
 
Reported: 2023-06-19 04:12 UTC by konsultor
Modified: 2024-01-25 22:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature: ["GetFrameOfModify(SwRootFrame const*, sw::BroadcastingModify const&, SwFrameType, SwPosition const*, std::pair<Point, bool> const*)","SwNode::FindTableNode()","SwNode::FindTableNode"]


Attachments
pdf file pasted into table (115.00 KB, application/pdf)
2023-09-05 18:08 UTC, konsultor
Details
replacement odt of table with pasted content in cells (234.15 KB, application/vnd.oasis.opendocument.text)
2023-09-07 02:58 UTC, konsultor
Details
odt file pasted into cells (individual card) (84.26 KB, application/vnd.oasis.opendocument.text)
2023-09-07 03:14 UTC, konsultor
Details
GDB trace of crash (7.61 KB, text/plain)
2023-09-26 06:27 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description konsultor 2023-06-19 04:12:45 UTC
Description:
To print multiple copies of business cards per page, inserted 3x26 table into ODT doc.  Separately created logo in Impress then exported as PDF, which was included in an ODT card.doc with type to form the business card.  Going from cell to cell in columns 1 and 3 inserting the card.odt, Writer crashes sometimes with something like "broken" at the end of a partially completed insertion of card.doc.  Adjusted column widths by dragging the vertical borders.

Steps to Reproduce:
1. create logo in Impress, export as .svg
2. insert logo.svg into card.odt then add text
3. create printer page by inserting 3  col x 16 line table in new odt
4. Insert/Text from file:  place card.odt into cells in cols 1 & 3
5. Writer may crash 

Actual Results:
Writer crashes when inserting test from file when the file contains a PDF logo 

Expected Results:
As happen s much of the time, the card.odt should occupy one cell of the table for each insertion


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
While setting up the exact dimensions and spacing, I adjusted column widths by dragging the vertical margins of the table with the mouse.

Version: 7.4.3.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 12; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Other functions performing OK so doesn't look like profile problem.
Comment 1 konsultor 2023-06-19 04:17:13 UTC
error displayed as 

!!br0ken!!
Comment 2 IvoErMejo 2023-06-19 07:23:58 UTC
Test done on Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: threaded

Bug not confirmed.
Comment 3 Stéphane Guillou (stragu) 2023-06-19 15:56:33 UTC
I am not able to reproduce either, even in 7.4.7.

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (en_AU.UTF-8); UI: en-US
Calc: threaded

- Please update to a currently supported version (7.5) and see if you still have the issue.
- Do you get a crash report dialog? If so, please submit a crash report and share the link here.
- If you can still reproduce, please share example files, with precise steps, so it is easier for us to test.

Thank you!
Comment 4 konsultor 2023-06-19 22:20:29 UTC
There was no crash report dialog like those that I've seen ask to use debug procedures and files. 
Repeated the paste actions several more times without a crash;  can't reproduce again at this time.
OpenSuse is due for a major update in a few weeks which I expect to bring LO 7.5.  Will try again then.
Thanks for your prompt attention.
Comment 5 QA Administrators 2023-06-20 03:13:40 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-06-20 06:30:40 UTC
I'm closing as "worksforme" for now as you can't reproduce, but if the issue pops up again in a recent version, please do set it back to "unconfirmed" and provide steps and files for others to test.
Thank you!
Comment 7 konsultor 2023-09-05 18:08:45 UTC
Created attachment 189373 [details]
pdf file pasted into table

PDF based on odt file that contains jpg image
Comment 8 konsultor 2023-09-05 18:10:13 UTC
Installed 7.5.4.1 (from openSuse) and tried the paste into table again.  Some changes noted:

--Can paste PDF image into a table without a crash, but edit/repeatInsert does nothing.  Same for jpg image:  can paste but can't repeat.
--Can paste the .odt file (the source for the pdf image) into the table once.  The second paste of the .odt using edit/repeat crashes Writer. The odt file tontaining the table was not saved between paste attempts.   Recovery restores all files, including the document under test.  I repeated this process four times but on the fifth pdf paste using edit/repeat nothing happened.  
--Can paste the odt file repeatedly with insert/pastFile without causing a crash.  

Also:
The pasted odt file contains text and a JPG image.
Comment 9 konsultor 2023-09-05 18:11:00 UTC Comment hidden (obsolete)
Comment 10 Stéphane Guillou (stragu) 2023-09-06 14:22:10 UTC
(In reply to konsultor from comment #8)
> Installed 7.5.4.1 (from openSuse) and tried the paste into table again. 
> Some changes noted:
> 
> --Can paste PDF image into a table without a crash, but edit/repeatInsert
> does nothing.  Same for jpg image:  can paste but can't repeat.

Are you sure that the image/pdf is not inserted right on top of the previous one? If you move it, you should see the other one underneath. You can also use the Navigator sidebar to confirm you have many copies.

> --Can paste the .odt file (the source for the pdf image) into the table
> once.  The second paste of the .odt using edit/repeat crashes Writer. The
> odt file tontaining the table was not saved between paste attempts.  
> Recovery restores all files, including the document under test.  I repeated
> this process four times but on the fifth pdf paste using edit/repeat nothing
> happened.  

How do you paste the ODT into the table? Using Ctrl + V, I get the Insert Section dialog. Using the default settings and clicking "Insert", the item "Repeat: paste clipboard" is greyed-out for me.

Please share the source ODT and more precise steps (including Insert Section settings if that's what you used) so we can try and reproduce the crash.

I used:

Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: ca8fe7424262805f223b9a2334bc7181abbcbf5e
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 11 konsultor 2023-09-07 02:58:19 UTC
Created attachment 189399 [details]
replacement odt of table with pasted content in cells
Comment 12 konsultor 2023-09-07 03:14:43 UTC
Created attachment 189400 [details]
odt file pasted into cells (individual card)
Comment 13 QA Administrators 2023-09-07 03:16:06 UTC Comment hidden (obsolete)
Comment 14 konsultor 2023-09-07 03:19:43 UTC
Created a fresh odt file with the table started empty (5x7, no heading) with same file name as earlier version (is that acceptable?).  Have annotated this table with steps 1), 2), etc. describing what i did.

After pasting PDF file, moving cursor to a blank cell, and using Edit/Repeat there is no effect visible to me.  PDF files are not stacked on top of previous pastes--there is only one image per cell.

Have not previously noticed the Insert/Section operation.  Never used it, would have to research what it is.  Did not use CTL+V for pastes.

After pasting odt file (individual card) into table with Insert/TextFromFile, I move cursor to another cell.  When clicking Edit the menu shows explicitly the  repeat of paste option. Click on Repeat and Writer crashes consistently.   

You are on version ahead of me (7.5.5 vs 7.5.4).  I wait for openSuse to update and 7.5.4 is their latest.

I'm not very experienced with this bug reporter and have made duplicate comments so I hope the first odt file with the table has been overwritten with the new version.  Also notice the previous attempt to upload odt file that is inserted failed--seem to have it this time  :-)
Comment 15 QA Administrators 2023-09-08 03:06:15 UTC Comment hidden (obsolete)
Comment 16 Buovjaga 2023-09-26 06:27:28 UTC
Created attachment 189820 [details]
GDB trace of crash

1. Open attachment 189399 [details]
2. In an empty cell, Insert - Text from file: attachment 189400 [details]
3. Move to another empty cell, Edit - Repeat

Even though debug build hits an assertion, the crash is reproduced with non-debug builds as well.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5e9c8d21874eea8cb5adf2ecab1905295af2308f
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 26 September 2023
Comment 17 Buovjaga 2023-09-26 06:54:30 UTC
This also crashes on Windows. Windows also shares the behaviour seen in the Linux bibisect repos.

With the last commit of linux-64-6.2 repo, I can insert and repeat just fine.

In the oldest of linux-64-6.3 it crashes upon the first insert. Same in the whole of linux-64-6.4.

In the oldest of linux-64-7.0, inserting does nothing. This changes to the current behaviour of insert working but repeat crashing with 0c4736a3e6b6e641579f517cf134ce2fd89fe132. Subject: "Resolves: tdf#129082 insert sheet from file fails"

Marking as notBibisectable. Maybe there is a way to bibisect, but not with the attached documents.
Comment 18 Stéphane Guillou (stragu) 2023-09-26 20:03:37 UTC
Thanks konsultor and buovjaga!

With your comment 17 steps, I get this crash report for LO 7.5: https://crashreport.libreoffice.org/stats/crash_details/02989537-3669-469a-9dc2-fb247dbed55c

Version: 7.5.6.2 (X86_64) / LibreOffice Community
Build ID: f654817fb68d6d4600d7d2f6b647e47729f55f15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3

But starting from an empty table, I get a different signature:

https://crashreport.libreoffice.org/stats/crash_details/9a3708b1-c712-464b-b0c9-6a2053cc13b1

Also crashes in both cases in 7.6.2.1 and a recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 19e9fe7c8c89399753ac1730e1c76378b18418bc
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3

Oddly, I have been able to bibisected it on my end. With the linux-64-6.3 repo, the first bad commit is 0bd28154c3dbd097efd20c92dd8c6c1dc98884b4 which points to core commit 3345feb67f2c49a1b76639965b56968e1c5f03ee which is a cherrypick of:

commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5
author	Michael Stahl Thu Jul 11 18:37:28 2019 +0200
committer	Michael Stahl 	Mon Jul 22 08:32:07 2019 +0200
tdf#117185 tdf#110442 sw: bring harmony & peace to fly at-char selection
Reviewed-on: https://gerrit.libreoffice.org/75516

Michael, can you please have a look?
Comment 19 Commit Notification 2024-01-18 12:25:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/359e5af31c330a137fed6ba3140b77cd759c28bb

tdf#155917 sw: fix Repeat of Insert File with Fly

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 20 Michael Stahl (allotropia) 2024-01-18 12:34:08 UTC
fixed on master
Comment 21 Stéphane Guillou (stragu) 2024-01-25 07:09:08 UTC
Thanks Michael, fix verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d0dcd87788910e3c9f67a2b68534019c05b77bad
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 22 konsultor 2024-01-25 22:28:28 UTC
My thanks to all of you involved in fixing this problem.