ZeroK-RTS / Zero-K-Infrastructure

Website, lobby launcher and server, steam deployment, .NET based tools and other vital parts of Zero-K infrastructure
GNU General Public License v3.0
53 stars 52 forks source link

Close wrapper program when chobby exits #1498

Open gajop opened 7 years ago

gajop commented 7 years ago

Chobby.exe wrapper keeps running even after Spring exits, leaving all these processes dangling:

ps axu | grep chobby
gajop     4595  0.9  0.4 1715612 150940 pts/20 Sl   12:43   2:39 /usr/bin/mono-sgen /home/gajop/chobby/Chobby.exe
gajop    17785  0.8  0.3 2129792 121504 ?      Sl    2月20  23:52 /usr/bin/mono-sgen /home/gajop/chobby/Chobby.exe
gajop    20001  0.8  0.3 2461524 116992 pts/20 Sl    2月21  15:07 /usr/bin/mono-sgen /home/gajop/chobby/Chobby.exe
Licho1 commented 7 years ago

Need to know more information, how was it started? Is there anything in logs?

db81 commented 7 years ago

There's no console output after [SpringApp::Run] exitCode=0. It happens every time on linux (unlike windows where it seems intermittent), regardless of how you start it (through steam or manually, with steam running or not).

Licho1 commented 7 years ago

Please in steam folder, delete files from root + cache folder and do verify local copy. Then start again. It works for me in ubuntu but my VM is unable to run spring so it just crashes after few seconds so i might not have the proper data.

gajop commented 7 years ago

@Licho1 This happened on a machine that didn't even have Steam installed.

Anarchid commented 7 years ago

Happens to me too. If i start from CLI, i can then finish it by killing the process with Ctrl+C.

Licho1 commented 7 years ago

Unable to replicate on my VM.. no idea how to fix or diagnose. Maybe it does not detect spring closes?

db81 commented 7 years ago

Run ubuntu from a liveCD to diagnose. Also try doing safe mode and all the jazz, I've "ran" spring in VirtualBox a year or so ago (it didn't crash but rendering was very glitchy).

Licho1 commented 7 years ago

It spits GameAnalyticsSDK.Net.Logging.GALogger Warning about "failed to send events to collector" over and

Seme background thread isn't marked as background and prevents app from exiting it seems.

Licho1 commented 7 years ago

Regarding some docs, class finalizers might be run during Environment.Exit(); so perhaps GA is preventing it?

Licho1 commented 7 years ago

I tried on ubuntu in VM ,with xfce, steam started from command line and it closed properly..

Anarchid commented 7 years ago

Still happens to me, so i thought i'd deliver a log: http://pastebin.com/cAn43Vka

Licho1 commented 7 years ago

Hmm, thats not a steam version.. retry with steam after next stable.

Anarchid commented 7 years ago

I was impatient so i tried steam version outright. It seems to exit nicely.

Licho1 commented 7 years ago

Retry again now after deployments i'm closing until it resurfaces.

db81 commented 7 years ago

Looks fixed here on Ubuntu.

Licho1 commented 7 years ago

ok great thanks! Nothing really fixed except missing native libs got deployed. So I guess the reason was missing steam libs.

gajop commented 7 years ago

This is still broken on Ubuntu 16.04 http://pastebin.com/kuhnzQL6

gajop commented 7 years ago

FWIW, this is still not fixed (at least when starting from command line). Chobby app is running and it shows me playing ZK on Steam, even after I've closed Chobby.

➜  chobby Chobby.exe Information: 0 : Checking for self-upgrade
Chobby.exe Information: 0 : PackageRefresh complete - packages changed
Chobby.exe Information: 0 : http://zkmenu.repo.springrts.com/packages/81a889fac450f43615830f9b168f79b9.sdp Completed - 68.71k
Chobby.exe Information: 0 : zkmenu:stable download complete - 4.62M
Chobby.exe Information: 0 : http://zk.repo.springrts.com/packages/3a30a1dd4d6ba944ad3906c6602fac22.sdp Completed - 206.01k
Chobby.exe Information: 0 : zk:stable download complete - 2.18M
Chobby.exe Information: 0 : Querying default engine
Chobby.exe Information: 0 : Downloading http://zero-k.info/engine/linux64/103.0.1-764-gae7487f.zip
Chobby.exe Information: 0 : Installing http://zero-k.info/engine/linux64/103.0.1-764-gae7487f.zip
Chobby.exe Information: 0 : Install of 103.0.1-764-gae7487f complete
Chobby.exe Information: 0 : Reseting configs and deploying AIs
Chobby.exe Information: 0 : Connecting to steam API
Setting breakpad minidump AppID = 334920
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198030304871 [API loaded no]
Chobby.exe Information: 0 : Steam online
Chobby.exe Information: 0 : Starting
Chobby.exe Information: 0 : Chobby connected to wrapper
Chobby.exe Information: 0 : Chobbyla >> SteamOnline {"AuthToken":"14000000DA8FBB75768D7B5A67B62C04010010014CFCF658180000000100000002000000A1C1D3990000000089D3E00001000000B8000000380000000400000067B62C0401001001481C0500A1C1D3990601A8C000000000473BEF58C7EA0A590100D3D700000100E8210500000000003430A862E30E184599B6932299D5568DA4372A3A00C3A05EA486147F78D6C92BED8B74DCF5EAE4BF579E8017479AE4EABFAEFF63CFE7A559A918A026A401E2A15B477F02076D6C75828688F9D9DDB0DAE37093723EF9302E3E653773DAC602DB5D5B57F9414A0B9F926A1BC927D5851FED54EB6DBB00A4FBE25E620C236EFC22","Friends":["76561197962341674","76561197986648420","76561197995941676","76561197996112180","76561198002991441","76561198004251271","76561198006545309","76561198024788385","76561198034325245","76561198036306441","76561198064290354","76561198064684016","76561198079508980","76561198091336838","76561198120754924","76561198132621338","76561198134242806","76561198191972850"],"SuggestedName":"gajop"}

Chobby.exe Information: 0 : Chobbyla >> WrapperOnline {"UserID":"486863943","DefaultServerHost":"zero-k.info","DefaultServerPort":8200}

Chobby.exe Information: 0 : Chobbyla << GaAddDesignEvent {"EventID":"lobby:started"}
Chobby.exe Information: 0 : Chobbyla << Alert {"Message":"Match found"}
Chobby.exe Information: 0 : Chobbyla << OpenUrl {"Url":"http://zero-k.info/Battles/Detail/455016?asmallcake=b378ff62-67fc-487b-80c1-dd40c4fd868c"}
Created new window in existing browser session.
[20593:20593:0419/192024.005865:ERROR:broker_posix.cc(41)] Invalid node channel message
Chobby.exe Information: 0 : Chobby closed connection

➜  chobby ps axu | grep chobby
gajop    19407  1.0  1.0 2490720 174784 pts/17 Sl   18:59   0:23 /usr/bin/mono-sgen /home/gajop/chobby/Chobby.exe
gajop    21170  0.0  0.0  15236   976 pts/17   S+   19:35   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn chobby
➜  chobby kill 19407
Histidine91 commented 6 years ago

Also having zombie wrapper.

Licho1 commented 6 years ago

should be fixed agfain

DeinFreund commented 6 years ago

This still seems to be an issue, bohan reported on discord that he can still find rogue Chobby.exe in his process list after closing the game window.

johan-boule commented 6 years ago

This happened to me with the game downloaded on April 22 (the debian package). The game was started from bash on a terminal, via the Zero-K wrapper script which actually made up the whole debian package (huh!). This is what the terminal shows: S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. Chobby.exe Information: 0 : Chobby closed connection 13:14:11 GameAnalyticsSDK.Net.Logging.GALogger Warning/GameAnalytics: Event queue: Failed to send events to collector - Retrying next time 13:14:19 GameAnalyticsSDK.Net.Logging.GALogger Warning/GameAnalytics: Event queue: Failed to send events to collector - Retrying next time 0;1R^C bohan@plasmoid:/tmp$

Notice that 0;1R looks like a truncated terminal escape sequence. ^C is me typing Ctrl+C because the process doesn't exits when you close the window. After that i was back to the bash prompt, and sometime after, i received another purple colored line at my bash prompt : bohan@plasmoid:/tmp$ 0:17:47 GameAnalyticsSDK.Net.Logging.GALogger Warning/GameAnalytics: Event queue: Failed to send events to collector - Retrying next time 20:17:55 GameAnalyticsSDK.Net.Logging.GALogger Warning/GameAnalytics: Event queue: Failed to send events to collector - Retrying next time

So this is when I noticed the background process still attached to my terminal. ps afxu shows : bohan 30853 0.4 0.8 4618968 144696 pts/4 Sl avril22 6:54 /usr/bin/mono-sgen /home/.no-ecryptfs/bohan/downloads/zero-k/Chobby.exe

I'm unable to reproduce this :-/

PS to Github: You do not allow us to be sad in your supercool newworld, so you're only proposing happy face simlies... Fascists! Also, pasting code is reaaaalllyyy painful, which is a shame of a site dedicated to ... code!

Licho1 commented 6 years ago

I guess broken steam support made it fail like that..

johan-boule commented 6 years ago

Should I deactivate steam in the settings ? I don't plan on signing up anyway.

Licho1 commented 6 years ago

This wont help its wrapper issue

Anarchid commented 5 years ago

Seems to be happening to windows users fairly frequently now. Still 100% replicable on Linux too. This prevents ZK from being launched from Steam after being launched and quit once ("Zero-K is already running").

Recently complaining people to interrogate:

Histidine91 commented 5 years ago

@Cat-Lady may have figured out the issue:

it tries to connect to steam api and fails if steam not present - but somehow, doesn't terminate the steam api connection attempt, even when ZK gets exit'ed (if at later time steam is turned On, it sucessfully connects, then gets idea that zk is closed, and finishes itself) so, when using steam, this problem doesn't exist, but without it, there is lingering process trying to connect to steam api ad infinitum, until killed

johan-boule commented 5 years ago

Great finding! I indeed experience this bug and I'm not a steam customer.On Jun 21, 2019 6:26 PM, "L.J. Lim" notifications@github.com wrote:@Cat-Lady may have figured out the issue:

it tries to connect to steam api and fails if steam not present - but somehow, doesn't terminate the steam api connection attempt, even when ZK gets exit'ed (if at later time steam is turned On, it sucessfully connects, then gets idea that zk is closed, and finishes itself) so, when using steam, this problem doesn't exist, but without it, there is lingering process trying to connect to steam api ad infinitum, until killed

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.