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

            Bug ID: 173010
           Summary: Crash attempting to convert a .docx containing
                    comments/annotations - to PDF, in --headless mode
           Product: Impress Remote
           Version: 2.2.0
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: medium
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I made a lib to talk libreoffice via UNO protocol. When processing a specific
file, LibreOffice crashed. Turns out:

1. file in question has comments/annotations,
2. the soffice package I used
(https://packages.debian.org/trixie-backports/libreoffice-writer-nogui) didn't
have the necessary UI component installed

I was hoping to avoid installing anything UI-related, and specifically intent
to run soffice in headless mode.

A workaround for me was to install package containing the missing component,
https://packages.debian.org/trixie-backports/libreoffice-uiconfig-writer.

LLM disclosure: I used a coding agent (Claude Opus 5) to debug the issue for me
via gdb, and prepare parts of this bug description.

Steps to Reproduce:
1. Remove or rename the Writer annotation UI definition, e.g.

   mv <install>/share/config/soffice.cfg/modules/swriter/ui/annotation.ui /tmp/

2. Start soffice headless with a UNO listening socket:

   soffice --headless --norestore \
     --accept="socket,host=0.0.0.0,port=2002,tcpNoDelay=1;urp;"

3. From any UNO client, load the attached comment-crash.docx through the
Desktop:

   desktop.loadComponentFromURL("file:///tmp/comment-crash.docx", "_blank", 0,
                                (PropertyValue("Hidden", 0, True,
DIRECT_VALUE),))

Actual Results:
The entire soffice process aborts (SIGABRT, exit code 134). It does not
return an error to the caller — the process dies, so every other document
open in that soffice instance dies with it.

  terminate called after throwing an instance of
    'com::sun::star::container::NoSuchElementException'
  Unspecified Application Error
Backtrace (gdb; symbols from the shared libraries, no debug package):
  #3  __gnu_cxx::__verbose_terminate_handler()
  #5  std::terminate()
  #6  __cxa_rethrow()
  #7  VclBuilder::VclBuilder(vcl::Window*, std::basic_string_view<char16_t...>,
...)
  #9  Application::CreateInterimBuilder(vcl::Window*, rtl::OUString const&,
...)
  #10 InterimItemWindow::InterimItemWindow(vcl::Window*, rtl::OUString const&,
...)
  #11 sw::annotation::SwAnnotationWin::SwAnnotationWin(SwEditWin&,
SwPostItMgr&, ...)
  #12 SwAnnotationItem::GetSidebarWindow(SwEditWin&, SwPostItMgr&)
  #13 SwPostItMgr::GetOrCreateAnnotationWindow(SwAnnotationItem&, bool&)
  #14 SwPostItMgr::LayoutPostIts()
  #16 SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent)
  #17 SalUserEventList::DispatchUserEvents(bool)
  #19 Application::Yield()
  #20 Application::Execute()
  #23 soffice_main()

Restoring annotation.ui makes the same document load and export to PDF
normally, so the missing file is the sole trigger.

Expected Results:
A missing optional UI resource should not terminate the process.


Reproducible: Always


User Profile Reset: No

Additional Info:
`soffice --headless --convert-to pdf` on the same installation converts the
file without the issue. Only the UNO/loadComponentFromURL path appears to be
affected.

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

Reply via email to