From f8d6cbdfe50fb003389d1ffd2e910caa54e4a006 Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Wed, 7 Jul 2021 00:19:08 -0700 Subject: [PATCH] Deobfuscate stacktraces in sync load info (#6103) --- ...stacktraces-in-log-messages-crash-report.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 4297ae4e59..2ee267605a 100644 --- a/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -92,7 +92,7 @@ index 1053799ea1f654e1885c46d34a145b9d9fd34a21..13d392b6f2715f1b905d8b93a7cd8df3 exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") } diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7acf077bc131af718c7548cc29deef558c04e463..73652e403eaa419fb5b4b54bd506f246c0aa4e99 100644 +index ffdacd1946c73e762b89b35c55a2e60eb7cd195b..98b71384508447adc80c2175f8e35e5d86b0c378 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -487,6 +487,11 @@ public class PaperConfig { @@ -107,6 +107,19 @@ index 7acf077bc131af718c7548cc29deef558c04e463..73652e403eaa419fb5b4b54bd506f246 public static int itemValidationDisplayNameLength = 8192; public static int itemValidationLocNameLength = 8192; public static int itemValidationLoreLineLength = 8192; +diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java +index 0bb4aaa546939b67a5d22865190f30478a9337c1..d3e619655382e50e9ac9323ed942502d85c9599c 100644 +--- a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java ++++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java +@@ -91,7 +91,7 @@ public class SyncLoadFinder { + + final JsonArray traces = new JsonArray(); + +- for (StackTraceElement element : pair.getFirst().stacktrace) { ++ for (StackTraceElement element : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(pair.getFirst().stacktrace)) { + traces.add(String.valueOf(element)); + } + diff --git a/src/main/java/io/papermc/paper/logging/StacktraceDeobfuscatingRewritePolicy.java b/src/main/java/io/papermc/paper/logging/StacktraceDeobfuscatingRewritePolicy.java new file mode 100644 index 0000000000000000000000000000000000000000..d019802a36dbaca4bf299a55d28381e43d6b976f