Bug 142772 - Zombie processes on Linux under docker focal image
Summary: Zombie processes on Linux under docker focal image
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-10 19:03 UTC by Ilya
Modified: 2023-09-13 03:17 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya 2021-06-10 19:03:10 UTC
Description:
Issue appears only with Docx/Doc documents when using Libre >= 7.0 (7.1, 7.2-pre).

After using libreoffice in headless mode for getting document content, the following processes are not finished and continue lives as zombie:
gpg
gpgsm
gpgconf

Issue is not reproduced with libreoffice 6.4

Steps to Reproduce:
1. Create a docker container using focal image (i.e. mcr.microsoft.com/dotnet/runtime:5.0-focal)
2. Install libreoffice and required components:
RUN apt-get update && \
	apt-get install software-properties-common -y && \
	apt-get update && \
	apt-add-repository ppa:libreoffice/libreoffice-prereleases && \
	apt-get install libreoffice -y && \

3. Run conversion of some Docx file:

RUN soffice --convert-to txt Document.docx --headless --nologo --norestore --invisible --nofirststartwizard --view

Actual Results:
Processes are not exited:
gpg
gpgsm
gpgconf

Expected Results:
Processes are finished


Reproducible: Always


User Profile Reset: Yes



Additional Info:
LibreOffice 7.1.4.2 10(Build:2)
Comment 1 Bodo 2023-09-12 13:41:32 UTC
I have encountered the same problem in a slightly different context on a current libreoffice: LibreOffice 7.0.4.2 00(Build:2)

My research shows that indeed libreoffice leaves the zombie gpg subprocesses, which are not reaped unless you have something like bash or an init process in your docker container as PID 1.

You can workaround the problem by using the `--init` parameter for `docker run` or `init: True` in docker-compose.

It would be preferable if libreoffice would not orphan any children however.

I was able to reproduce the issue by having an absolute minimal example.pdf, using the following Dockerfile:

> FROM python:3.11-slim
> 
> RUN apt-get update \
>   && apt-get install libreoffice-draw-nogui --yes \
>   && rm -rf /var/lib/apt/lists/*
> 
> COPY example.pdf ./

Then build and run with
> docker build -t lo-zombie .
> docker run --name zombie -ti --rm lo-zombie:latest

Create zombies (again from host):
> docker exec zombie libreoffice --convert-to odg example.pdf
> ps fax | grep gpg

Output:
> 1273473 ?        Z      0:00      \_ [gpgconf] <defunct>
> 1273475 ?        Z      0:00      \_ [gpgconf] <defunct>
> 1273477 ?        Z      0:00      \_ [gpg] <defunct>
> 1273479 ?        Z      0:00      \_ [gpgsm] <defunct>
> 1273481 ?        Z      0:00      \_ [gpgconf] <defunct>