https://bugs.documentfoundation.org/show_bug.cgi?id=174464

            Bug ID: 174464
           Summary: Text (.txt) export of a DOCX whose body ends with a
                    table never finishes and repeats the last cell until
                    the disk is full
           Product: LibreOffice
           Version: 26.8.1.1 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Exporting a DOCX to plain text never finishes when the last element of the
document body is a table, with no paragraph after it. LibreOffice keeps
appending the content of the last table cell to the output, one line after
another, until it is killed or the disk fills up. In my case the temporary file
in the output directory reached 13 GB before /tmp (a 16 GB tmpfs) ran out of
space.

The same document converts to PDF and ODT normally, and the ODT converts to
text normally. A DOCX with the same table followed by a paragraph also converts
to text normally. Whether the table has merged cells makes no difference.

Steps to Reproduce:
1. Take the attached table_at_end.docx: a 3×2 table and nothing after it.
2. Run: soffice --headless --convert-to txt --outdir out table_at_end.docx

Actual Results:
The conversion never ends. A file named lu*.tmp in the output directory keeps
growing. It contains the table text once, followed by the last cell ("R2")
repeated without end. With ulimit -f set to 5 MB, the file reached that limit
about two seconds after the start, and the process then kept running until
timeout killed it after 30 seconds.

Expected Results:
A small text file with the table contents, as produced for
table_then_paragraph.docx.

Reproducible: Always

Additional Info:
The DOCX files were written by python-docx, which does not add a paragraph
after a table that ends the document. "txt:Text (encoded):UTF8" behaves the
same as "txt". Converting table_at_end.docx to pdf or odt works.

Version: 26.8.1.1 (openSUSE Tumbleweed package libreoffice-26.8.1.1-1.3.x86_64)
OS: Linux, openSUSE Tumbleweed

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to