Paper/CraftBukkit-Patches/0132-Prevent-NoClassDefError-crash-and-notify-on-crash.patch
Zach Brown cab333b217 Rebase (Update) from upstream SpigotMC
Don't send requests of every player was found in the global api cache SpigotMC/Spigot@841270ff1e
Correctly set the response code for the cached lookups and return the ... SpigotMC/Spigot@f170b7899c
Don't try and re-set the global api cache on reload SpigotMC/Spigot@b410a00a66
Use a compile time sneaky throw hack. SpigotMC/Spigot@508462b96b
Fix a missed rename in WorldGenGroundBush SpigotMC/Spigot@0614d8fae9
2014-11-28 14:19:07 -06:00

51 lines
2.7 KiB
Diff

From a37a61a62676afd0be16d7b334cdeef1ce07762c Mon Sep 17 00:00:00 2001
From: David <dmck2b@gmail.com>
Date: Mon, 21 Apr 2014 12:43:08 +0100
Subject: [PATCH] Prevent NoClassDefError crash and notify on crash
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 554023a..e7cf335 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -111,6 +111,8 @@ public abstract class World implements IBlockAccess {
protected float growthOdds = 100;
protected float modifiedOdds = 100;
private final byte chunkTickRadius;
+ public static boolean haveWeSilencedAPhysicsCrash;
+ public static String blockLocation;
public static long chunkToKey(int x, int z)
{
@@ -631,6 +633,9 @@ public abstract class World implements IBlockAccess {
// CraftBukkit end
block1.doPhysics(this, i, j, k, block);
+ } catch (StackOverflowError stackoverflowerror) { // Spigot Start
+ haveWeSilencedAPhysicsCrash = true;
+ blockLocation = i + ", " + j + ", " + k; // Spigot End
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being updated");
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index de08ad6..94a3d42 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -60,6 +60,13 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
log.log( Level.SEVERE, "Spigot version: " + Bukkit.getServer().getVersion() );
//
+ if(net.minecraft.server.World.haveWeSilencedAPhysicsCrash)
+ {
+ log.log( Level.SEVERE, "------------------------------" );
+ log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
+ log.log( Level.SEVERE, "near " + net.minecraft.server.World.blockLocation);
+ }
+ //
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().primaryThread.getId(), Integer.MAX_VALUE ), log );
--
1.9.1