Zombie Processes Running Certain Games in Docker Container

OS Name/Version: Debian GNU/Linux 12 (bookworm)

Product Name/Version: AMP Release “Callisto” v2.5.0.14, built 14/06/2024 03:45

Problem Description:

Running certain games (I was able to replicate with V Rising and Conant Exhiles) will result in zombie process (<defunct>) inside of container when running that are never reaped.

Starting and stopping the game will create additional zombie processes on the system.

This may be related to wine, but I’m not sure.

The general solution to this type of problem is to use an init (like tini) or specify --init when using docker run, but I don’t see a mechanism to enable init inside of docker run by AMP.

root      372150       1  0 15:19 ?        00:00:00   /usr/bin/containerd-shim-runc-v2 -namespace moby -id 868ea76cd437419763629a111b565763b038f1c1f9887160c59409431d0ac165 -address /run/containerd/containerd.sock
root      372171  372150  0 15:19 ?        00:00:00     su -l -w AMPHOSTPLATFORM,AMP_CONTAINER,AMPMEMORYLIMIT -c ampinstmgr --sync-certs; cd /AMP; HOME=/home/amp /AMP/AMP_Linux_x86_64 +Core.Webserver.Port "8084" +Core.Webserver.IPBinding "127.0.0.1" +Core.AMP.InstanceID "fc0f3033-7866-43fc-9ca1-01b1163d2689" +Core.Security.MetricsHMAKKey "7dd0f661-2a95-4b28-b211-721f8f543cb9"; exit 0 -- amp
amp       372227  372171  0 15:19 ?        00:00:00       -bash -c ampinstmgr --sync-certs; cd /AMP; HOME=/home/amp /AMP/AMP_Linux_x86_64 +Core.Webserver.Port "8084" +Core.Webserver.IPBinding "127.0.0.1" +Core.AMP.InstanceID "fc0f3033-7866-43fc-9ca1-01b1163d2689" +Core.Security.MetricsHMAKKey "7dd0f661-2a95-4b28-b211-721f8f543cb9"; exit 0
amp       372233  372227  1 15:19 ?        00:00:08         /AMP/AMP_Linux_x86_64 +Core.Webserver.Port 8084 +Core.Webserver.IPBinding 127.0.0.1 +Core.AMP.InstanceID fc0f3033-7866-43fc-9ca1-01b1163d2689 +Core.Security.MetricsHMAKKey 7dd0f661-2a95-4b28-b211-721f8f543cb9
amp       373730  372233  0 15:25 ?        00:00:00           /bin/sh /usr/bin/xvfb-run -a wine ./VRisingServer.exe -persistentDataPath /AMP/v-rising/1829350/save-data
amp       373740  373730  0 15:25 ?        00:00:00             Xvfb :99 -screen 0 1280x1024x24 -nolisten tcp -auth /tmp/xvfb-run.bnuef1/Xauthority
amp       373743  373730  0 15:25 ?        00:00:00             start.exe /exec ./VRisingServer.exe -persistentDataPath
amp       372307  372171  0 15:19 ?        00:00:01       [wineserver] <defunct>
amp       372309  372171  0 15:19 ?        00:00:00       [wineboot.exe] <defunct>
amp       372311  372171  0 15:19 ?        00:00:00       [winemenubuilder] <defunct>
amp       372313  372171  0 15:19 ?        00:00:00       [services.exe] <defunct>
amp       372316  372171  0 15:19 ?        00:00:00       [winedevice.exe] <defunct>
amp       372318  372171  0 15:19 ?        00:00:00       [explorer.exe] <defunct>
amp       372328  372171  0 15:19 ?        00:00:00       [winedevice.exe] <defunct>
amp       372341  372171  0 15:19 ?        00:00:00       [plugplay.exe] <defunct>
amp       372350  372171  0 15:19 ?        00:00:00       [svchost.exe] <defunct>
amp       372358  372171  0 15:19 ?        00:00:00       [rpcss.exe] <defunct>
amp       372367  372171  0 15:19 ?        00:00:00       [wineboot.exe] <defunct>
amp       372369  372171  0 15:19 ?        00:00:00       [wineboot.exe] <defunct>
amp       372371  372171  0 15:19 ?        00:00:00       [winemenubuilder] <defunct>
amp       372373  372171  0 15:19 ?        00:00:00       [services.exe] <defunct>
amp       372375  372171  0 15:19 ?        00:00:00       [rundll32.exe] <defunct>
amp       372378  372171  0 15:19 ?        00:00:00       [winedevice.exe] <defunct>
amp       372386  372171  0 15:19 ?        00:00:03       [rundll32.exe] <defunct>
amp       372401  372171  0 15:19 ?        00:00:00       [iexplore.exe] <defunct>
amp       372405  372171  0 15:19 ?        00:00:02       [rundll32.exe] <defunct>
amp       372407  372171  0 15:19 ?        00:00:00       [winedevice.exe] <defunct>
amp       372417  372171  0 15:19 ?        00:00:00       [iexplore.exe] <defunct>
amp       372488  372171  0 15:19 ?        00:00:03       [wineserver] <defunct>
amp       372490  372171  0 15:19 ?        00:00:00       [wineboot.exe] <defunct>
amp       372492  372171  0 15:19 ?        00:00:00       [winemenubuilder] <defunct>
amp       372494  372171  0 15:19 ?        00:00:00       [services.exe] <defunct>
amp       372497  372171  0 15:19 ?        00:00:00       [explorer.exe] <defunct>
amp       372499  372171  0 15:19 ?        00:00:00       [winedevice.exe] <defunct>
amp       372508  372171  0 15:19 ?        00:00:02       [winedevice.exe] <defunct>
amp       372521  372171  0 15:19 ?        00:00:00       [plugplay.exe] <defunct>
amp       372529  372171  0 15:19 ?        00:00:00       [svchost.exe] <defunct>
amp       372537  372171  0 15:19 ?        00:00:00       [rpcss.exe] <defunct>
amp       372546  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       372572  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       372583  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       372594  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       372605  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       372616  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373202  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373227  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373238  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373249  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373260  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373271  372171  0 15:19 ?        00:00:00       [cmd.exe] <defunct>
amp       373306  372171 11 15:19 ?        00:00:51       [VRisingServer.e] <defunct>
amp       373308  372171  0 15:19 ?        00:00:00       [UnityCrashHandl] <defunct>
amp       373310  372171  0 15:19 ?        00:00:00       [explorer.exe] <defunct>
amp       373384  372171  0 15:19 ?        00:00:00       [crashpad_handle] <defunct>
amp       373464  372171  0 15:21 ?        00:00:00       [UnityCrashHandl] <defunct>
amp       373489  372171  1 15:21 ?        00:00:04       [wineserver] <defunct>
amp       373491  372171  0 15:21 ?        00:00:00       [wineboot.exe] <defunct>
amp       373493  372171  0 15:21 ?        00:00:00       [winemenubuilder] <defunct>
amp       373495  372171  0 15:21 ?        00:00:00       [services.exe] <defunct>
amp       373498  372171  0 15:21 ?        00:00:00       [explorer.exe] <defunct>
amp       373500  372171  0 15:21 ?        00:00:00       [winedevice.exe] <defunct>
amp       373510  372171  1 15:21 ?        00:00:04       [winedevice.exe] <defunct>
amp       373524  372171  0 15:21 ?        00:00:00       [plugplay.exe] <defunct>
amp       373532  372171  0 15:21 ?        00:00:00       [svchost.exe] <defunct>
amp       373540  372171  0 15:21 ?        00:00:00       [rpcss.exe] <defunct>
amp       373549  372171 20 15:21 ?        00:01:07       [VRisingServer.e] <defunct>
amp       373551  372171  0 15:21 ?        00:00:00       [UnityCrashHandl] <defunct>
amp       373622  372171  0 15:21 ?        00:00:00       [crashpad_handle] <defunct>
amp       373720  372171  0 15:25 ?        00:00:00       [UnityCrashHandl] <defunct>
amp       373745  372171  2 15:25 ?        00:00:02       /opt/wine-stable/bin/wineserver
amp       373747  372171  0 15:25 ?        00:00:00       [wineboot.exe] <defunct>
amp       373749  372171  0 15:25 ?        00:00:00       [winemenubuilder] <defunct>
amp       373751  372171  0 15:25 ?        00:00:00       C:\windows\system32\services.exe
amp       373753  372171  0 15:25 ?        00:00:00       C:\windows\system32\explorer.exe /desktop
amp       373756  372171  0 15:25 ?        00:00:00       C:\windows\system32\winedevice.exe
amp       373765  372171  2 15:25 ?        00:00:02       C:\windows\system32\winedevice.exe
amp       373777  372171  0 15:25 ?        00:00:00       C:\windows\system32\plugplay.exe
amp       373787  372171  0 15:25 ?        00:00:00       C:\windows\system32\svchost.exe -k LocalServiceNetworkRestricted
amp       373795  372171  0 15:25 ?        00:00:00       C:\windows\system32\rpcss.exe
amp       373804  372171 37 15:25 ?        00:00:44       Z:\AMP\v-rising\1829350\VRisingServer.exe -persistentDataPath /AMP/v-rising/1829350/save-data
amp       373806  372171  0 15:25 ?        00:00:00       Z:\AMP\v-rising\1829350\UnityCrashHandler64.exe --attach 260 140737466142720
amp       373880  372171  0 15:25 ?        00:00:00       Z:/AMP/v-rising/1829350/VRisingServer_Data\Plugins\x86_64\crashpad_handler.dll --no-rate-limit --database=C:\users\amp\AppData\LocalLow\Stunlock Studios\VRisingServer\backtrace\crashpad --metrics-dir=C:\users\amp\AppData\LocalLow\Stunlock Studios\VRisingServer\backtrace\crashpad --url=https://submit.backtrace.io/stunlock/a263069ae6d724a816c45f703e75a9d33cfec66fbfb561387bf5c59f3d253015/minidump --annotation=format=minidump --annotation=thread.main=264 --initial-client-data=0xa9c,0xaa0,0xaa8,0xa98,0xab0,0x6ffffbfe06a0,0x6ffffbfe06b8,0x6ffffbfe06d0

Steps to reproduce:

  • Deploy new instance of V Rising or Conan Exhiles with Docker (this may be replicable with other Wine games)
  • Start Game
  • Observe zombie processes on system produced by container
  • Stop + Start game (repeat)
  • Observe accumulated zombie processes.

Actions taken to resolve so far:

I’ve tried to find if there is a way to enable --init to docker flags, but I don’t see a good way to do that. I also looked in the Dockerfiles provided by CubeCoders/dockerfiles and I didn’t see any indiciation that tini or similar init was provided for Wine containers, or if there is a way to enable that.

The zombie processes are reaped when AMP instance is restarted, but some may still exist on start.

Yeah, it is wine stuff, no mechanism in AMP to avoid it. Stopping the instance clears the zombies.

I understand that it appears that zombie processes in Docker is current behavior, but I strongly believe this should be considered as a bug and not expected behavior.

As proof of concept, I built a container, added tini to entrypoint, and then pointed one of my test Wine games at this container. This fixes the bug - zombie processes are now reaped.

FROM cubecoders/ampbase:wine8

RUN apt-get update && \
        apt-get -y upgrade && \
        apt-get -y install tini && \
        apt-get clean && \
        rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/usr/bin/tini", "--", "/ampstart.sh"]
CMD []

Can this be addressed upstream?

This could fixed upstream I see one of 3 ways, but I’m sure there are others.

  • Updating “docker run” in AMP to include --init parameter (this launches entrypoint with built-in tini)
  • Install tini on ampbase and updating exec line in ampstart.sh to use tini
  • Install tini on ampbase and and updating entrypoint in Dockerfile to tini as show above

I don’t disagree at all that this is undesirable behaviour. I just don’t have any control over the docker image builds - only Mike does. Please feel free to raise an issue on the AMP GitHub to see if the situation can be improved. Though iirc it is not just an issue for instances run in docker

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.