Bug 156348 - Crash if change in formatting in Writer by converting text to table with field variable
Summary: Crash if change in formatting in Writer by converting text to table with fiel...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Writer-Tables
  Show dependency treegraph
 
Reported: 2023-07-18 11:21 UTC by gerhard.schaden
Modified: 2023-10-10 07:52 UTC (History)
6 users (show)

See Also:
Crash report or crash signature: ["GoPreviousWithFrame(SwNodeIndex*, SwFlowFrame const**)"]


Attachments
Minimal document to reproduce the bug (9.14 KB, application/vnd.oasis.opendocument.text)
2023-07-18 11:24 UTC, gerhard.schaden
Details
gdb bt (13.45 KB, text/plain)
2023-07-18 12:04 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gerhard.schaden 2023-07-18 11:21:55 UTC
Description:
When I try to create a table in Writer from a tabulation-separated text, and deselect the option "Equal width for all columns", LibreOffice crashes.

Steps to Reproduce:
1. Open a new document
2. Create a new field by going to INSERT > FIELD > MORE FIELDS > Variables > Number Range ; enter "NumEx" in the "Name" field, then click "Insert"
3. Place cursor after the inserted number, press "Tab", enter some word, press "Tab", enter some word
4. Select the created text with the mouse
5. Chose TABLE > CONVERT > TEXT TO TABLE
6. In the pop-up menu, click "OK"

Actual Results:
LibreOffice crashes

Expected Results:
A table is created where each word is in a cell


Reproducible: Always


User Profile Reset: Yes

Additional Info:
In safe mode, if I deselect the "Equal width for all columns" option, LibreOffice does not crash. In normal mode, LibreOffice crashes only if the "Equal width for all columns" option is selected.

Without the field variable, the table is created without any problem, and LibreOffice does not crash.

Version: 7.4.7.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 12; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
7.4.7-5
Calc: threaded
Comment 1 gerhard.schaden 2023-07-18 11:24:00 UTC
Created attachment 188430 [details]
Minimal document to reproduce the bug

To reproduce the bug:

1. Select the text with the mouse
2. TABLE > CONVERT > TEXT TO TABLE 
3. Click OK
Comment 2 gerhard.schaden 2023-07-18 11:29:48 UTC
Just to be clear: LibreOffice Writer can crash in both safe and normal mode. The only difference is that in one condition, Writer crashes when "Equal width for all columns" is selected; in the other, Writer crashes when "Equal width for all columns" is DEselected.
Comment 3 Julien Nabet 2023-07-18 12:04:37 UTC
Created attachment 188434 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 4 Julien Nabet 2023-07-18 12:27:58 UTC
Michael: noticing 9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749
sw: fix expansion of SetGetExpField in headers with split table rows

thought you might be interested in this one.
Comment 5 Stéphane Guillou (stragu) 2023-07-18 13:14:43 UTC
I got the crash report https://crashreport.libreoffice.org/stats/crash_details/b6ecde21-c74a-4367-937a-5d89c9df6ddb with:

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

The setting "Equal width for all columns" does not matter, I was able to reproduce regardless of it with:

1. open attachment 188430 [details]
2. Table > convert > text to table > OK
3. Ctrl + z
4. Table > convert > text to table > OK

Also happens in:

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

Regression as not reproduced in:

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
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 6 raal 2023-07-18 14:48:48 UTC Comment hidden (obsolete)
Comment 7 Stéphane Guillou (stragu) 2023-07-18 14:53:13 UTC Comment hidden (obsolete)
Comment 8 raal 2023-07-18 16:17:27 UTC Comment hidden (obsolete)
Comment 9 Stéphane Guillou (stragu) 2023-07-19 13:34:30 UTC
Bibisected with comment 5 steps with linux-64-7.3 repo to first bad commit e22741875593ab5feeec486c916f03780e05ad81 which points to core commit 855e2af1bf6eb216d63ca7baeb9161c7cd501a42 which is a cherrypick of:

commit 9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749
author	Michael Stahl Tue Apr 05 18:27:35 2022 +0200
committer	Michael Stahl Wed Apr 06 19:51:19 2022 +0200
sw: fix expansion of SetGetExpField in headers with split table rows
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132641

... which confirms what Julien suspected in comment 4.

Even quicker steps:

1. open attachment 188430 [details]
2. Ctrl + A
3. Table > convert > text to table > OK
4. Ctrl + Z
5. Ctrl + Y

Michael, can you please have a look?
Comment 10 Stéphane Guillou (stragu) 2023-10-10 07:52:45 UTC
(In reply to Stéphane Guillou (stragu) from comment #9) 
> 1. open attachment 188430 [details]
> 2. Ctrl + A
> 3. Table > convert > text to table > OK
> 4. Ctrl + Z
> 5. Ctrl + Y
> 
> Michael, can you please have a look?

I had another look, and as raal mentioned already, 7.5, 7.6 and 24.2 now all crash on step 3. Thanks raal for that!

I can confirm the start of that with the linux-64-7.5 repo to first bad commit ae083ec6a3ce351a0fd8884d8c5e762ddd4b6c37 which points to core commit c8e9df0b583e8a61a0570f72c0a476a5102f1fe9 which is a cherrypick of:

commit c132a1abd57c109331191c3b3fbd14e1c5e46631
author	Samuel Mehrbrodt 	Mon Mar 06 17:00:10 2023 +0100
committer	Samuel Mehrbrodt 	Mon Mar 13 20:12:52 2023 +0000
Always update fields when loading document
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148355

Not sure if this should be reported separately.
Michael and Samuel, can you please have a look? Happy to open a separate report if needed.