PocketMine / PocketMine-MP

Legacy PocketMine-MP repository. Head to https://github.com/pmmp for up to date software.
https://www.pocketmine.net/
GNU Lesser General Public License v3.0
1.25k stars 660 forks source link

unpack(): Type N: not enough input, need 4, have 0 #3138

Closed xxddff closed 9 years ago

xxddff commented 9 years ago

This leads me to the server to crash(2-3 times one day collapse,the same problem) This is the log: PocketMine-MP Crash Dump Mon Jun 8 19:21:53 BNT 2015

Error: unpack(): Type N: not enough input, need 4, have 0 File: /src/pocketmine/level/format/mcregion/RegionLoader__64bit Line: 268 Type: warning

Code: [259] \ftruncate($this->filePointer, ($sector + 1) << 12); //Truncate to the end of file written [260] return $shift; [261] } [262] [263] protected function loadLocationTable(){ [264] \fseek($this->filePointer, 0); [265] $this->lastSector = 1; [266] $table = \fread($this->filePointer, 4 * 1024 * 2); //1024 records * 4 bytes * 2 times [267] for($i = 0; $i < 1024; ++$i){ [268] $index = \unpack("N", \substr($table, $i << 2, 4))[1]; [269] $this->locationTable[$i] = [$index >> 8, $index & 0xff, \unpack("N", \substr($table, 4096 + ($i << 2), 4))[1]]; [270] if(($this->locationTable[$i][0] + $this->locationTable[$i][1] - 1) > $this->lastSector){ [271] $this->lastSector = $this->locationTable[$i][0] + $this->locationTable[$i][1] - 1; [272] } [273] } [274] } [275] [276] private function writeLocationTable(){ [277] $write = []; [278]

Backtrace:

0 /src/pocketmine/level/format/mcregion/RegionLoader__64bit(268): unpack(string N, string )

1 /src/pocketmine/level/format/mcregion/RegionLoader__64bit(69): pocketmine\level\format\mcregion\RegionLoader->loadLocationTable()

2 /src/pocketmine/level/format/mcregion/McRegion64bit(312): pocketmine\level\format\mcregion\RegionLoader->construct(pocketmine\level\format\mcregion\McRegion object, integer -1, int

eger -1)

3 /src/pocketmine/level/format/mcregion/McRegion__64bit(200): pocketmine\level\format\mcregion\McRegion->loadRegion(integer -1, integer -1)

4 /src/pocketmine/level/format/mcregion/McRegion__64bit(262): pocketmine\level\format\mcregion\McRegion->loadChunk(integer -12, integer -1, boolean 1)

5 /src/pocketmine/level/Level__64bit(2367): pocketmine\level\format\mcregion\McRegion->getChunk(integer -12, integer -1, boolean 1)

6 /src/pocketmine/level/Level__64bit(2037): pocketmine\level\Level->loadChunk(integer -12, integer -1, boolean 1)

7 /src/pocketmine/level/Level__64bit(2635): pocketmine\level\Level->getChunk(integer -12, integer -1, boolean 1)

8 /src/pocketmine/Player__64bit(678): pocketmine\level\Level->populateChunk(integer -12, integer -1)

9 /src/pocketmine/Player__64bit(1520): pocketmine\Player->sendNextChunk()

10 /src/pocketmine/Server__64bit(2489): pocketmine\Player->checkNetwork()

11 /src/pocketmine/Server__64bit(2291): pocketmine\Server->tick()

12 /src/pocketmine/Server__64bit(2169): pocketmine\Server->tickProcessor()

13 /src/pocketmine/Server__64bit(1774): pocketmine\Server->start()

14 /src/pocketmine/PocketMine(464): pocketmine\Server->__construct(pocketmine\CompatibleClassLoader object, pocketmine\utils\MainLogger object, string phar:///root/pm/PocketMine-MP.phar/, string /root/pm/, string /root/pm/plugins/)

15 (1): require(string phar:///root/pm/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

PocketMine-MP version: 1.5dev #1229 [Protocol 27; API 1.12.0] Git commit: 0000000000000000000000000000000000000000 uname -a: Linux iZ94ewjujnyZ 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Nov 6 15:06:03 UTC 2014 x86_64 PHP Version: 5.6.2 Zend version: 2.6.0 OS : Linux, linux

Loaded plugins: SimpleAuth 1.7.1 by PocketMine Team, shoghicp for API(s) 1.12.0 MoveLight 1.0.1 by boybook for API(s) 1.8.0 KeepInventory 1.2.0 by boybook for API(s) 1.0.0 PopupDisplayer 1.0 by Heromine/Jon for API(s) 1.12.0 CommandSigns 2 by Samueljh1 for API(s) 1.0.0 SimpleMacros 0.3 by PEMapModder for API(s) 1.0.0 SimpleAuthHelper 1.2.3 by aliuly for API(s) 1.10.0 ALLSurvival 1.2.1 by PMPCT-Zzm for API(s) 1.0.0 Gills 2.0.0 by Falkirks for API(s) 1.7.0 RandomItem 4.2 by LDX for API(s) 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0 Whois 3 by hoyinm for API(s) 1.12.0 CustomChat INDEV by Array for API(s) 1.7.1 EconomyGamble 2.0-alpha by hmm for API(s) 1.4.1 AshMan 1.0.1 by FENGberd,Alcatraz_Du for API(s) 1.0.0 BanCommands 1.0.0 by 18wyj2 for API(s) 1.0.0 DelBear 1.1.0 by 4u for API(s) 1.3.0 SpawnWithItems 2 by LDX for API(s) 1.1.0 PurePerms 1.1.2 by 64FF00 for API(s) 1.12.0 essentialsTP 1.0.9 by for API(s) 1.0.0 PocketGuard 2.1.1 by MinecrafterJPN for API(s) 1.10.0 BackQUIT 1.0.0 by fxxk for API(s) 1.0.0 TimeCapsule 1.1.1 by Falk for API(s) 1.0.0 EconomyAPI 2.0.7 by onebone for API(s) 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1 PeacefulSpawn 2.4 by LDX for API(s) 1.3.1, 1.4.0 BanItemAdd 1.2.1 by zzx for API(s) 1.9.0 OreBroadcast 0.0.1 by Falkirks for API(s) 1.9.0 DontTapTheWhiteTile 0.1.2 by MUedsa for API(s) 1.8.0 EconomyAirport 2.0.4 by onebone for API(s) 1.12.0 NoCheat 1.1.2 by PeratX for API(s) 1.11.0 FastTransfer 1.0.2 by shoghicp for API(s) 1.12.0 ItemCloud 1.1 by onebone for API(s) 1.4.0 TMDRL 1.0.0 by labi for API(s) 1.0.0 CustomAlerts 1.4 by EvolSoft for API(s) 1.12.0 EconomyJob 2.0.3 by onebone for API(s) 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1 ItemCasePE 1.0.5 by aliuly for API(s) 1.10.0 QD 2.0.0 by labi for API(s) 1.0.0 SWorld 1.1.0 by 18WYJ2 & boybook for API(s) 1.0.0 EconomyLand 2.0.7 by onebone for API(s) 1.12.0 EconomyUsury 1.0.0 by onebone for API(s) 1.12.0 EconomyAuction 2.0.2 by onebone for API(s) 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1 EconomyTax 2.0.2 by onebone for API(s) 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1 EconomySell 2.0.5 by onebone for API(s) 1.12.0 EconomyProperty 2.0.4 by onebone for API(s) 1.12.0 EconomyPShop 2.0.0 by onebone for API(s) 1.6.0, 1.7.0 EconomyShop 2.0.5 by onebone for API(s) 1.12.0 SignWarp 1.3.2 by aliuly for API(s) 1.10.0 WorldProtect 1.2.4 by aliuly for API(s) 1.10.0

shoghicp commented 9 years ago

Your world is corrupted