3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00
Paper/CraftBukkit-Patches/0101-Prevent-NoClassDefError-crash-and-notify-on-crash.patch

51 Zeilen
2.8 KiB
Diff

2016-03-06 04:36:33 +01:00
From bcc01c9b44c796ef04203f34f2bcbe0e4f5c29ce 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
2016-03-06 04:36:33 +01:00
index 7765812..2257f0f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
2016-02-29 22:33:06 +01:00
@@ -127,6 +127,8 @@ public abstract class World implements IBlockAccess {
public final SpigotTimings.WorldTimingsHandler timings; // Spigot
private boolean guardEntityList; // Spigot
+ public static boolean haveWeSilencedAPhysicsCrash;
+ public static String blockLocation;
2016-02-29 22:33:06 +01:00
public CraftWorld getWorld() {
return this.world;
2016-03-06 04:36:33 +01:00
@@ -536,6 +538,9 @@ public abstract class World implements IBlockAccess {
2014-11-28 02:17:45 +01:00
}
// CraftBukkit end
2014-11-28 02:17:45 +01:00
iblockdata.getBlock().doPhysics(this, blockposition, iblockdata, block);
+ } catch (StackOverflowError stackoverflowerror) { // Spigot Start
+ haveWeSilencedAPhysicsCrash = true;
2014-11-28 02:17:45 +01:00
+ blockLocation = blockposition.getX() + ", " + blockposition.getY() + ", " + blockposition.getZ(); // 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 );
--
2016-02-29 22:33:06 +01:00
2.5.0