Running "wineserver -k" Creates Defunct Process

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
User avatar
Enverex
Level 2
Level 2
Posts: 10
Joined: Tue Nov 25, 2008 12:03 pm
Location: UK
Contact:

Running "wineserver -k" Creates Defunct Process

Post by Enverex » Fri Jun 23, 2017 6:04 pm

Thought I'd post here for some feedback first to confirm it's a bug before logging it.

Anyway, I have a "emergency exit everything" button mapped on a controller which kills a bunch of programs that may be running. It kills off Wine by running...

Code: Select all

su arcade -c "WINEPREFIX=/mnt/store/Wine wineserver -k" &
su arcade -c "WINEPREFIX=/mnt/store/Wine64 wineserver -k" &
(the script runs as root and the actual user is "arcade" hence the su).

Anyway, this has worked fine for the most part, but doesn't seem to work with CEmu, which causes Wine to zombie the process when you run the above. So whilst everything is running normally, ps looks like this:

Code: Select all

arcade   31375 69.2 40.6 10294376 3199332 ?    Rl   23:34   0:11 C:\CEmu\Cemu.exe -f -g Z:\mnt\store\Emulation\Games\Nintendo - Wii U\Mario Kart 8 [AMKE01]\code\Turbo.rpx
arcade   31384  0.0  0.0 1979232 7112 ?        Ssl  23:34   0:00 C:\windows\system32\services.exe
arcade   31387  0.0  0.1 2137780 8356 ?        Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31397  0.0  0.0 1845864 6756 ?        Sl   23:34   0:00 C:\windows\system32\plugplay.exe
arcade   31403  0.0  0.1 2139692 10016 ?       Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31414  0.2  0.2 1942492 22576 ?       Ssl  23:34   0:00 C:\windows\system32\explorer.exe /desktop
But then running the above "wineserver -k" commands results in this...

Code: Select all

arcade   31375 96.3  0.0      0     0 ?        Zl   23:34   0:28 [Cemu.exe] <defunct>
arcade   31384  0.0  0.0 1979232 7112 ?        Ssl  23:34   0:00 C:\windows\system32\services.exe
arcade   31387  0.0  0.1 2137780 8356 ?        Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31397  0.0  0.0 1845864 6756 ?        Sl   23:34   0:00 C:\windows\system32\plugplay.exe
arcade   31403  0.0  0.1 2139692 10016 ?       Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31414  0.1  0.2 1942492 22576 ?       Ssl  23:34   0:00 C:\windows\system32\explorer.exe /desktop
Running another method of cleanup...

Code: Select all

WINEPREFIX=/mnt/store/Wine64 wineboot --end-session --shutdown --force --kill
... also doesn't seem to have any effect.

Code: Select all

arcade   31375  6.6  0.0      0     0 ?        Zl   23:34   0:29 [Cemu.exe] <defunct>
arcade   31384  0.0  0.0 1979232 7112 ?        Ssl  23:34   0:00 C:\windows\system32\services.exe
arcade   31387  0.0  0.1 2137780 8356 ?        Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31397  0.0  0.0 1845864 6756 ?        Sl   23:34   0:00 C:\windows\system32\plugplay.exe
arcade   31403  0.0  0.1 2139692 10016 ?       Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31414  0.0  0.2 1942492 22576 ?       Ssl  23:34   0:00 C:\windows\system32\explorer.exe /desktop
Even if I then kill off CEmu manually, Wine seems to stick around...

Code: Select all

killall Cemu.exe -9

arcade   31384  0.0  0.0 1979232 7112 ?        Ssl  23:34   0:00 C:\windows\system32\services.exe
arcade   31387  0.0  0.1 2137780 8356 ?        Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31397  0.0  0.0 1845864 6756 ?        Sl   23:34   0:00 C:\windows\system32\plugplay.exe
arcade   31403  0.0  0.1 2139692 10016 ?       Sl   23:34   0:00 C:\windows\system32\winedevice.exe
arcade   31414  0.0  0.2 1942492 22576 ?       Ssl  23:34   0:00 C:\windows\system32\explorer.exe /desktop
What's even more odd is that there is no wineserver process anymore, just those handful of Wine exes.

Code: Select all

[12:04:14] arcade@arcade ~ $ ps aux | grep wine
arcade    6615  0.0  0.0  11096  2412 pts/0    S+   00:04   0:00 grep wine
arcade   31387  0.0  0.1 2137780 8356 ?        Sl   Jun23   0:00 C:\windows\system32\winedevice.exe
arcade   31403  0.0  0.1 2139692 10016 ?       Sl   Jun23   0:00 C:\windows\system32\winedevice.exe
Basically it looks like wineserver fails to kill CEmu, kills itself and then leaves its children orphaned. I either have to kill them all manually and individually, or restart X11.

Locked