-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console becomes unresponsive after several hours idle. #104
Comments
Is the title bar still updating (It probaby is, because you can join) |
Yes, the title bar is still actively updating. Lots of action there. |
It did it again. 2016-11-15 [01:43:34] [Server thread/INFO]: Enabled Timings & Reset |
I am running Build 76 again overnight. This time I set the debug level to 2. Perhaps this will generate useful information. |
Debug level 2 is unlikely to generate useful information. |
Thank you. 2 yielded nothing new. same failure, no data. |
https://github.com/robske110/pmmp-PocketMine-MP/tree/patch-1 |
It is time for me to slow down and be more scientific. More gets done faster that way. Then, @robske110, I would like to run your software. (Yes, I have Windows 10 Pro) @robske110, please correct me on this if needed. |
There's no such thing as debug level 3. 1 is off, 2 is on. Stupid but true. #blameshoghi |
Thanks, dktapps. Someone suggested... |
A thought... Someone has speculated "Out of Memory". I thought that this was impossible in my case, because I am using at maximum only 59% of my 8 GB. However, in php.ini, I see a memory limit set to 256 MB. Perhaps this memory limit is being exceeded. This problem has the classic symptoms of a "Memory Leak". |
A quick search of "memory leak php" and "resource leak php" reveals that these issues continue to plague PHP applications. Of particular interest is http://php.net/ChangeLog-7.php (Ctrl-F search the page for "leak") |
@KAGsundaram this is not a memory leak. Stdin just likes to go missing. Please try my version, it only adds debug. |
I can confirm this with the same version as @KAGsundaram . Though, I haven't begun to think about what is causing it. Although, in older versions of Pocketmine (I think Pocketmine Dev 1266 1.6 first release by @Intyre on the old forums) this bug was at large |
this is a bug with stdin. I can reproduce it with this: public function __construct(){
global $stdin;
$stdin = fopen("php://stdin", "r");
stream_set_blocking($stdin, 0);
}
public function run(){
while(!$this->doExit){
$foundInput = false;
while(!$foundInput){
global $stdin;
sleep(1);
$input = trim(fgets($stdin));
if($input != NULL || $input != ""){
$foundInput = true;
}else{
echo("[ERROR] Stdin corrupted!".PHP_EOL); //This message shows up roughly every 10 minutes
$stdin = fopen("php://stdin", "r");
stream_set_blocking($stdin, 0);
}
}
$this->processCMD($this->processRawInput($input));
}
} Please do not add any more comments that are not helping to resolve this issue. |
Well, it looks like php.ini has all possible debug (except php_xdebug.dll, and I am NOT going there today) turned on already, so I can skip that step. Unless someone suggests a /bin/ link, and/or a /bin/php/ link, in the next few minutes, I will proceed with what I have. I will proceed with the steps listed above and run @robske110 's software. |
Proceeding. |
they should be here, #106 has different code. |
Procedure changed It is running now. |
Wait, you need to use my modiefied code. Do not use PM's phar |
patch-1 doesn't seem to include everything. |
Next test (proposed): (1) New Pocketmine-MP folder |
Results of run WITHOUT the phar present (to avoid the phar overwriting patch-1 files): [CRITICAL] Unable to find the PocketMine-SPL library. |
Run again, with patch-1 files, and PocketMine-MP_1.6.1dev-76_8214e50b_API-2.1.0.phar as PocketMine-MP.phar So far so good. PocketMine-MP 1.6.1dev-#76 | Online 0/20 | Memory 16.12/0/16.12/20 MB @ 6 threads | U 0 D 0 kB/s | TPS 20 | Load 0.31% [16:02:22] [Server thread/INFO]: This server is running PocketMine-MP 1.6.1dev-#76 「Unleashed」 implementing API version 2.1.0 for Minecraft: PE v0.16.0.5 alpha (protocol version 91) We shall see how long the console remains responsive. |
Console unresponsive after less than two hours. No error messages, no debug output that I could find. |
Ok, you were supposed to run only from src, not from a phar. Well, i'm going to compile a phar for youy |
Try it with this phar: |
Did you have time to do it yet? |
PocketMine-MP_1.6.1dev.phar.zip has exhibited the same behavior. |
PocketMine-MP_1.6.1dev.phar.zip |
In a little bit. Right now I have some outside work, aligning a Ka/Ku band satellite antenna before daylight fades. |
The test is running now. See the message thread for details. |
When the program starts, the response to the keyboard is normal, plus some very interesting debug output. version After two hours, the console is four lines of debug output repeated a seemingly infinite number of times: fgets: By rapidly, repeatedly striking one key, for example "x", a quick eye will occasionally see the "x" flash by. It seems that console lockup mode is a tight loop discarding all input characters. |
Ok, it looks like it suddenly got non-blocking. Does it respond to your cmds at that stage? And if it really is throwing bool(false) in fgets at you, there is probably nothing ghat i can do. |
Another identical test, same results, except at the end, I tested "Does it respond to your cmds at that stage?" by typing the "help" command. (Chosen because it is the command with the maximum console output.) There was no visible evidence that the command had been honored. However, the program did respond properly to Ctrl-C. Either the the program in this condition can only respond to single-character commands, or Ctrl-C is handled at a lower level, before characters are passed to this part of the program. |
CTRL+C is handled by the system and sent to php I actually managed to fix this issue, PR is going to be updated now |
@robske110 why the windows sucks i use windows my consol dont froze and i use windows 10 pro |
Windows sucks for development. That is a fact. There is no need to elaborate this any further. |
Ouch. Please check properly before you do post usless comments. |
I think it's important to note that |
Yes, we know that and I have done the same hack in PR #106. |
@daterrell See #25 also |
Issue description
On both PocketMine-MP_1.6.1dev-73_794ff643_API-2.1.0 and PocketMine-MP_1.6.1dev-76_8214e50b_API-2.1.0, (Windows 10 Pro) after two or more hours of operation, unattended with no players in the game, upon returning to the console there is no response to commands. The game is still functioning, players may login and the world responds normally. However, at the console (the server terminal window), commands such as "list" or "version" are ignored. Characters typed appear on the screen, but without effect. Ctrl-C is recognized, terminating the program.
Steps to reproduce the issue
OS and versions
[23:37:31] [Server thread/INFO]: This server is running PocketMine-MP 1.6.1dev-#76 「Unleashed」 implementing API version 2.1.0 for Minecraft: PE v0.16.0.5 alpha (protocol version 91)
Title Bar: PocketMine-MP 1.6.1dev-Src #76 | Online 0/20 | Memory 16.11/0/16.11/20 MB @ 6 threads | U 0 D 0 kB/s | TPS 20 | Load 0.28%
PocketMine-MP: PocketMine-MP_1.6.1dev-76_8214e50b_API-2.1.0
PHP: PHP7.0.13
Server OS: Windows 10 Pro
Game version: PE
Crashdump, backtrace or other files
The text was updated successfully, but these errors were encountered: