I recently downloaded PHP 7 and been trying to make my core plugin work on it, everything seems to run fine except AsyncTask code. For some reason, my server always crashes when it the task reaches the onCompletion method. I haven't experienced this issue on PHP 5. Not sure what is really going on here, probably something changed in PHP/pthreads? Here is the crash dump, something about pthreads not able to access an object that has already been destroyed, not sure... Code: PocketMine-MP Crash Dump Sat Feb 27 22:00:23 CST 2016 Error: pthreads detected an attempt to connect to an object which has already been destroyed File: /plugins/LeafCTF-OOP/src/rekkuzarage/leaf/ctf/tasks/onQueryTask Line: 142 Type: notice THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: LeafCTF v1.2.0 Code: [133] case "syncCoins": [134] $server->getPluginManager()->getPlugin("LeafCTF")->queryTaskDone($this->getMethod, $this->log, $this->getPlayer); [135] break; [136] [137] case "syncKD": [138] $server->getPluginManager()->getPlugin("LeafCTF")->queryTaskDone($this->getMethod, $this->log, $this->getPlayer); [139] break; [140] [141] case "syncRanks": [142] $server->getPluginManager()->getPlugin("LeafCTF")->queryTaskDone($this->getMethod, $this->log, $this->getPlayer); [143] break; [144] [145] case "saveRanks": [146] $server->getPluginManager()->getPlugin("LeafCTF")->queryTaskDone($this->getMethod, $this->log, $this->getPlayer); [147] break; [148] [149] case "playerRegistered": [150] $server->getPluginManager()->getPlugin("LeafCTF")->queryTaskDone($this->getMethod, $this->log, $this->getPlayer); [151] break; [152] Below is the actual code. A partial version of my core's main class and the AysncTask class. Hopefully, enough information to solve this issue
Thanks! It is fixed now, I guess you can't pass arrays through threads with pthreads (PHP 7). Also below is a comment from Krakjoe (a developer of pthreads) that is better worded. He is basically saying that arrays will be destroyed/deleted when set as a property of a thread, please correct me if I'm wrong. "array coerced to Volatile when set as member of Threaded" ~ Krakjoe