Closed robske110 closed 7 years ago
xD 2016-05-29 [19:07:55] [Server thread/EMERGENCY]: Crashed while crashing, killing process
How can it crash while crashing?
Anyways, I tried this out and it works good. Thanks! It should be merged
@XtremePlayzCODE while handling a critical error (more precisely, after handling a critical error and trying to gracefully stop the server), another critical error happened.
Therefore, this issue may be caused by the critical error that caused the initial crash, which may have led to the LevelProvider being null.
Also note that PocketMine code style prefers the use of !== null
to !== NULL
.
@SOF3 Yes, the example crash happened while forcefully stopping the server. But this error can happen while normal running too, i explained th conditions in my inital post.
To that !== null, I will change that, i hope to not mess this thing up with rebase
It feels strange if you add the !== null
for every single call. Just like the hasPermission() crash about kicking players in some events. Those calls simply shouldn't have happened at all, so returning dummy values isn't a proper way to fix it. Meanwhile checking if player is kicked after every of these event calls seems to be very strange.
This is really a debatable problem in software engineering.
Maybe, well i have no real idea Maybe just make all level functions wich use the level provider checking if it is null?
@robske110 that's what I was saying: will be very strange to do some pretty unnecessary/minor checks in every single usage. Affects code quality and appearance overall.
Closing due to fixed in #pmmp :)
I don't know exactly when this is happening. But it seems to happen if a player's spawnposition is in a level wich was previously loaded, but then unloaded. (Then the next autosave gets called => save() gets a level wich is closed therefore the provider has became (probably even destructed) null wich triggers this getName() on null.) We should consider checking on all level get functions that are using the provider variable to check if the provider is not null (level not closed) for less plugin crashes
Here is a Traceback wich helped me: