Pocketmine-mp: Crash issues [Chunk Error]

Created on 8 Dec 2016  路  19Comments  路  Source: pmmp/PocketMine-MP

Issue description


Very often after a reset of a map, the server crash with this error, i checked and the maps is loaded, i don't know why :|. Some friends have the same problem.

Steps to reproduce the issue

  1. ... Reset a map (unload and load it)
  2. ... join the world, the server will crash 1/6 with this error

OS and versions

  • PocketMine-MP: 5d16ecc
  • PHP: 7.0.2
  • Server OS: Debian
  • Game version: PE/Win10

Crashdump, backtrace or other files

  • ... Console : 016-12-08 Unloading level "BuildUHC1vs1(2)"
    Preparing level "BuildUHC1vs1(2)"
    Unloading level "BuildUHC1vs1(2)"
    reparing level "BuildUHC1vs1(2)"
    Error: "Call to a member function getChunk() on null" (EXCEPTION) in "/src/pocketmine/level/Level" at line 2462
    An unrecoverable error has occurred and the server has crashed. Creating a crash dump
    An unrecoverable error has occurred and the server has crashed. Creating a crash dump
Core Awaiting Response

Most helpful comment

It happens with mcpe 1.0 branch too, others servers have this issues we need it to ne fixed :(

All 19 comments

It concerns that line
-> $chunk = $this->provider->getChunk($x, $z, $generate);

Oh and it's caused by .mcr worlds i think cause when the server crash it's caused by a map in .mcr world format and never by .mca worlds, is it possible to convert the worlds or to fix that ?

Please provide a proper crashdump.

Ok i going to send you one now ;)

This is the crashdumps 馃憤 @dktapps

```
Crash Dump Thu Dec 8 09:14:32 EST 2016

Error: Call to a member function getChunk() on null
File: /src/pocketmine/level/Level
Line: 2764
Type: notice

Code:
[2755] public function loadChunk(int $x, int $z, bool $generate = true) : bool{
[2756] if(isset($this->chunks[$index = Level::chunkHash($x, $z)])){
[2757] return true;
[2758] }
[2759]
[2760] $this->timings->syncChunkLoadTimer->startTiming();
[2761]
[2762] $this->cancelUnloadChunkRequest($x, $z);
[2763]
[2764] $chunk = $this->provider->getChunk($x, $z, $generate);
[2765] if($chunk === null){
[2766] if($generate){
[2767] throw new \InvalidStateException("Could not create new Chunk");
[2768] }
[2769] return false;
[2770] }
[2771]
[2772] if($this->provider->getProviderName() == "mcregion"){
[2773] if($chunk->getBiomeColor(0, 0) == [0, 0, 0]){
[2774] for($x = 0; $x < 16; ++$x){

Backtrace:

0 /src/pocketmine/Player(954): pocketmine\level\Level->registerChunkLoader(pocketmine\Player Player(32), integer 8, integer 19, boolean 1)

1 /src/pocketmine/Player(2027): pocketmine\Player->sendNextChunk(boolean)

2 /src/pocketmine/Server(2905): pocketmine\Player->checkNetwork(boolean)

3 /src/pocketmine/Server(2594): pocketmine\Server->tick(boolean)

4 /src/pocketmine/Server(2472): pocketmine\Server->tickProcessor(boolean)

5 /src/pocketmine/Server(2053): pocketmine\Server->start(boolean)

6 /src/pocketmine/PocketMine(467): pocketmine\Server->__construct(pocketmine\CompatibleClassLoader object, pocketmine\utils\MainLogger object, string /home/srv1/, string /home/srv1/, string /home/srv1/plugins/, string unknown)

It makes my server so instable please fix it :|, this is the second error
Unloading level "BuildUHC1vs1(2)"
Preparing level "BuildUHC1vs1(2)"
Unloading level "BuildUHC1vs1(2)"
Preparing level "BuildUHC1vs1(2)"
Error: "Call to a member function startTiming() on null" (EXCEPTION) in "/src/pocketmine/level/format/mcregion/McRegion" at line 209
An unrecoverable error has occurred and the server has crashed. Creating a crash dump
Please upload the "/home/srv1/crashdumps
This error happens when i delete the $this->provider = null;
Please help @dktapps :(

Can you share the code you are using to perform these level unloads and reloads?

-

@dktapps

Please use ``` around code blocks in future.

done @dktapps

Is it possible to check if the chunk exist so the server will not crash or something like that ?

Do you have some news about that ? @dktapps

I haven't been able to identify what the cause of this bug may be. The issue appears to be that the level is retained after it's unloaded, which causes the unloaded level to be returned from Server->getLevelByName() instead of the newly loaded one. I can't identify what in the core could result in this happening, so I'm afraid that right now I can't help you. This will be investigated in more detail at a later date.

Sorry for bumping this, but didn't you fix it last time? There was a similar issue, and you implemented WeakPosition to address it.

It happens with mcpe 1.0 branch too, others servers have this issues we need it to ne fixed :(

I finally found the origin of the crash (not sure), when you teleport a player in a zone where the chunk aren't load for exemple (EnderPearl) the server crash.

@Misteboss Would you try to reproduce with branch issues/156 and report back what issues occur? Please make sure to set zend.assertions = 1 in your php.ini for testing.

Closing due to lack of response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KAGsundaram picture KAGsundaram  路  43Comments

kenygamer picture kenygamer  路  92Comments

SOF3 picture SOF3  路  20Comments

mal0ne-23 picture mal0ne-23  路  17Comments

zKoz210 picture zKoz210  路  27Comments