Pocketmine-mp: The world is infinitely unloading.

Created on 27 Jan 2018  Â·  50Comments  Â·  Source: pmmp/PocketMine-MP

Issue description

The server freezes without cause and other errors in the unloading of the world. Another strange thing is that the process no longer exists.
im

OS and versions

  • PocketMine-MP: 41592a04b7d0124d155ea6d99be8f11fe14d1de1
  • PHP: 7.2.1
  • Server OS: Linux Debian 8.6 jessie

Plugins

DevTools v1.12.7, ModalFormsAPI v1, clans v1, quests v1, DonateCases v1, RegionGuard v1.0.0, area v1, Kits v1.0.0, Shop v1, Economy v1, MineReset v3, PurePerms v1.4.0-INDEV, Evaluator v0.0.1, Horses v1.0.0, ToyBox v1, API v1.0.0, PureChat v1.4.0

PHP (extension) Hack-fixed

Most helpful comment

I've reproduced the bug - calling Item::initCreativeItems() during onEnable() of a POSTWORLD plugin will trigger the bug (thank you @daniktheboss )

I did some digging into this and it appears to be a problem with the way pthreads handles static members. On further investigation I found a variety of interesting issues including heap corruption.

This will be reported upstream.

All 50 comments

does it happen without any players too?

it would be appreciated if you could reproduce this with debug output enabled.

@dktapps you mean X debug?

no, I mean debug log level in pocketmine.yml

I can also add that this shit started to happen after January 18-19. Prior to this, with 84 players, the server did not freezes in unloading of the world.

@Frago9876543210 please watch your language.

It would be more helpful to know after which versions the bug started to occur. Also:

  • plugins? specifically if you're using TeaSpoon then no support can be provided
  • is the bug consistent or random?

@dktapps

  • Plugins list added.
  • The error occurs entirely by accident. It is impossible to predict when it will happen.

you're running Evaluator on a production server? 💀

Yea. This is a very useful thing. For example, to fix some errors without rebooting.

I also encountered such a problem, however, it was only once.

I also have this problem random happen when the server stop
My Server Log with debug open :

[08:56:26] [Server thread/DEBUG]: Unloading all levels
[08:56:26] [Server thread/INFO]: Unloading level "lobby"
[08:56:26] [Server thread/INFO]: Unloading level "nether"
[08:56:26] [Server thread/INFO]: Unloading level "ender"
[08:56:26] [Server thread/INFO]: Unloading level "resources02"
[08:56:26] [Server thread/INFO]: Unloading level "resources01"
[08:56:26] [Server thread/INFO]: Unloading level "residence01"
[08:56:26] [Server thread/DEBUG]: Removing event handlers
[08:56:26] [Server thread/DEBUG]: Stopping all tasks
[08:56:26] [Server thread/DEBUG]: Closing console
[08:56:26] [Server thread/DEBUG]: Stopping network interfaces

And my server cpu usage always 100 % when this happen

If someone can reproduce this with debug logging enabled, or offer ways to reproduce this, it would be much appreciated. I have never encountered this issue.

Another strange thing is that the process no longer exists.

correction - it's just not bound to port 19132 anymore, which would indicate that RakLib's socket has closed (due to shutdown).

I Have this with the asyn branch

Op 27-jan.-2018 14:56 schreef "Frago9876543210" notifications@github.com:

Issue description

The server freezes without cause and other errors in the unloading of the
world. Another strange thing is that the process no longer exists.
[image: im]
https://camo.githubusercontent.com/5e7d0a3782299832531a8c1e8ea2162bce0f4a9e/68747470733a2f2f736e61672e67792f676c397836472e6a7067
OS and versions

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/pmmp/PocketMine-MP/issues/1974, or mute the thread
https://github.com/notifications/unsubscribe-auth/APEEPuTGkYyJEi-oq9Xou0l0XdRueS_hks5tOysngaJpZM4RvTRc
.

For me, this happens when I have a plugin which removing items from creative inventory. I catched this problem about 2 month ago (nov. 2017).

UPD: maybe not because of plugin which removing items from creative inventory. Maybe because of plugin which removing items from creative inventory THAT IS NOT EXISTS (talking about items)

Do you use removeCreativeItem or unregisterCommand functions?

Unless you have something constructive to add to the discussion, please take the conversation elsewhere. This is not a support forum. Anything which does not directly pertain to the reported issue does not belong here.

@dktapps After using these functions, I have the same problem.

Sorry, bad English

@dktapps
im

so RakLib is getting stuck for some reason. Thanks @Frago9876543210 .

@Frago9876543210 would you mind making some modifications to RakLib and add some debug output into this function? https://github.com/pmmp/RakLib/blob/master/server/ServerHandler.php#L70-L78

It appears that RakLib is getting stuck while shutting down, but it is unclear why.

@dktapps ok. What add?

Add some echo or var_dump() messages so that I can see what point it's getting stuck at.

like this?
im

that should be fine, yes.

Can this log be used ?

[17:50:50] [Server thread/DEBUG]: Unloading all levels
[17:50:50] [Server thread/INFO]: Unloading level "lobby"
[17:50:50] [Server thread/INFO]: Unloading level "nether"
[17:50:50] [Server thread/INFO]: Unloading level "ender"
[17:50:50] [Server thread/INFO]: Unloading level "resources03"
[17:50:50] [Server thread/INFO]: Unloading level "resources02"
[17:50:50] [Server thread/INFO]: Unloading level "resources01"
[17:50:50] [Server thread/INFO]: Unloading level "residence01"
[17:50:50] [Server thread/DEBUG]: Removing event handlers
[17:50:50] [Server thread/DEBUG]: Stopping all tasks
[17:50:50] [Server thread/DEBUG]: Closing console
[17:50:50] [Server thread/DEBUG]: Stopping network interfaces
#1
#2
#3
#4
#5
Done

that's strange indeed... so it's not RakLib at all...

@xinghao2003 am I correct to assume that your server is then stuck after "done"?

Yes

that's very odd... hmm... I'm not sure what else could cause this.

I've pushed a commit to add additional debug for server shutdown. Please try it and report back where issues occur.

Latest Log

[19:18:07] [Server thread/DEBUG]: Unloading all levels
[19:18:07] [Server thread/INFO]: Unloading level "lobby"
[19:18:07] [Server thread/INFO]: Unloading level "nether"
[19:18:07] [Server thread/INFO]: Unloading level "ender"
[19:18:07] [Server thread/INFO]: Unloading level "resources03"
[19:18:07] [Server thread/INFO]: Unloading level "resources02"
[19:18:08] [Server thread/INFO]: Unloading level "resources01"
[19:18:08] [Server thread/INFO]: Unloading level "residence01"
[19:18:08] [Server thread/DEBUG]: Removing event handlers
[19:18:08] [Server thread/DEBUG]: Stopping all tasks
[19:18:08] [Server thread/DEBUG]: Closing console
[19:18:08] [Server thread/DEBUG]: Stopping network interfaces
[19:18:08] [Server thread/DEBUG]: Stopping network interface pocketmine\network\mcpe\RakLibInterface
#1
#2
#3
#4
[19:18:08] [RakLibServer thread/DEBUG]: Closed session for 115.132.200.23 55710
#5
Done
[19:18:08] [Server thread/DEBUG]: Stopping network interface specter\network\SpecterInterface
[19:18:08] [Server thread/DEBUG]: Collecting cycles

hmmmmmm... you're never seeing "stopping other threads"...

could you add some debug output after this line?
https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Server.php#L2106

and in these lines:
https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/PocketMine.php#L556-L569

Okay, It still stuck at Collecting cycles

this might be a GC issue in PHP then. This is very difficult to debug without being able to reproduce it myself.

If anyone would care to try and reproduce this without plugins, it would be appreciated.

I've been facing this error too for the past couple of days, except it's been more severe just this week. I see you are running PHP 7.2.1 and I was too. I know this sounds really stupid as I don't have any exact justification for this but upgrading to PHP 7.2.2 solved this for me. I've not got any issues with PHP 7.2.2 so far. Can you upgrade your PHP and see if the problem persists?

I will try it, thanks

This issue still happen in PHP 7.2.2

Seems like PHP 7.2.2 make this issue happen every time I stop the server and maybe this was really a GC issue in PHP because it more serious in newer PHP version

Please try it without plugins. I cannot reproduce this bug at all, so while it might well be a PHP bug, whatever is triggering the bug needs to be isolated if possible.

@xinghao2003 not only on 7.2.2. I got this error with php 7.2.0 & 7.2.1

Reproduced again

Simply saying you reproduced it is not helpful in the slightest. I need to know under what circumstances it was reproduced and what triggered it.

@Frago9876543210 Do you have a plugin that registers or uses a custom world generator?

@Muqsit no. I can also note that this error was on the old hosting with low ghz per core.

If I try to unload with a player on the server and in that world, it works fine. Without player it doesn't unload.

I've reproduced the bug - calling Item::initCreativeItems() during onEnable() of a POSTWORLD plugin will trigger the bug (thank you @daniktheboss )

I did some digging into this and it appears to be a problem with the way pthreads handles static members. On further investigation I found a variety of interesting issues including heap corruption.

This will be reported upstream.

Upstream PR'd test case (no fix): https://github.com/krakjoe/pthreads/pull/861

This has not been fixed in pthreads but may have been resolved by recent changes on the master branch (no child threads in PocketMine-MP inherit loaded classes anymore), could someone confirm?

Note that this doesn't account for threads started by plugins.

Closing this since it doesn't occur any longer (unless using custom threads, which is a bug for pthreads to fix).

изображение
I have it again on 4.0
Note: My server use outdated PM 0ba3121c436206d86377b41120bf1a7266c3416d
Before was same with RconServer plugin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Muqsit picture Muqsit  Â·  3Comments

RedstoneAlmeida picture RedstoneAlmeida  Â·  3Comments

Ox531 picture Ox531  Â·  3Comments

nmo0ory picture nmo0ory  Â·  3Comments

XDqrkneZ picture XDqrkneZ  Â·  3Comments