Rendersystem called from wrong thread
maxanier opened this issue ยท 7 comments
Describe the bug
I received a crashreport for a mod of mine. But as far as I can tell it is merely triggered by Vampirism not caused. See crashlog below. Note: This is for Mubble 31.0.1, but the affected file hasn't been changed in between
It seems like https://github.com/Hugman76/Mubble/blob/e4996186f83e227306b4b8f4d367da810f0a1356/src/main/java/hugman/mubble/objects/event_handler/ShaderHandler.java#L33 is executed on the Server thread.
I am not entirely familar with the Dist filter of the EventBusSubscriber but I assume it does not care about the thread, but only ensures that the code is not executed on a standalone server.
Therefore an additional world.isRemote or similar check could solve this issue.
Side note: I don't know why you are stopping shaders here, but I assume you have added your own shaders elsewhere. However, if another mod would add shaders (like Vampirism does) those would also get immediatly canceled by this. Maybe you can check the shaderGroup before stopping it.
To Reproduce
Don't know as I did not have this issue myself. If the crashreport is not sufficient, just disregard this issue.
Crashlog
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 16/03/20 10:16 PM
Description: Ticking player
java.lang.IllegalStateException: Rendersystem called from wrong thread
at com.mojang.blaze3d.systems.RenderSystem.assertThread(SourceFile:81) ~[?:?] {re:classloading}
at net.minecraft.client.shader.Framebuffer.func_147608_a(SourceFile:72) ~[?:?] {re:classloading}
at net.minecraft.client.shader.ShaderGroup.close(ShaderGroup.java:263) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.func_181022_b(GameRenderer.java:111) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at hugman.mubble.objects.event_handler.ShaderHandler.onArmorChange(ShaderHandler.java:33) ~[?:?] {re:classloading}
at net.minecraftforge.eventbus.ASMEventHandler_682_ShaderHandler_onArmorChange_LivingUpdateEvent.invoke(.dynamic) ~[?:?] {}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-2.0.0-milestone.1-service.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.0.0-milestone.1-service.jar:?] {}
at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:314) ~[?:?] {re:classloading}
at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2022) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:233) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:fml:vampirism:playersize,xf:fml:backpacked:player_init_hook}
at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:fml:backpacked:creative_inventory_action_fix}
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228) ~[?:?] {re:classloading}
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135) ~[?:?] {re:classloading}
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:864) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:782) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:635) [?:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Unknown Source) [?:1.8.0_231] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Server thread
Stacktrace:
at com.mojang.blaze3d.systems.RenderSystem.assertThread(SourceFile:81)
at net.minecraft.client.shader.Framebuffer.func_147608_a(SourceFile:72)
at net.minecraft.client.shader.ShaderGroup.close(ShaderGroup.java:263)
at net.minecraft.client.renderer.GameRenderer.func_181022_b(GameRenderer.java:111)
at hugman.mubble.objects.event_handler.ShaderHandler.onArmorChange(ShaderHandler.java:33)
at net.minecraftforge.eventbus.ASMEventHandler_682_ShaderHandler_onArmorChange_LivingUpdateEvent.invoke(.dynamic)
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:314)
at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2022)
at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:233)
-- Player being ticked --
Details:
Entity Type: minecraft:player (net.minecraft.entity.player.ServerPlayerEntity)
Entity ID: 416
Entity Name: 1996pilot
Entity's Exact location: 367.39, 47.00, -189.57
Entity's Block location: World: (367,47,-190), Chunk: (at 15,2,2 in 22,-12; contains blocks 352,0,-192 to 367,255,-177), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Entity's Momentum: 0.00, -0.08, 0.00
Entity's Passengers: []
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361)
at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228)
-- Ticking connection --
Details:
Connection: net.minecraft.network.NetworkManager@a8ccd65
Stacktrace:
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:864)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:782)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:114)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:635)
at java.lang.Thread.run(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.15.2
Minecraft Version ID: 1.15.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_231, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 2858799656 bytes (2726 MB) / 6442450944 bytes (6144 MB) up to 6442450944 bytes (6144 MB)
CPUs: 8
JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx6G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
ModLauncher: 5.0.0-milestone.4+67+b1a340b
ModLauncher launch target: fmlclient
ModLauncher naming: srg
ModLauncher services:
/eventbus-2.0.0-milestone.1-service.jar eventbus PLUGINSERVICE
/forge-1.15.2-31.1.17.jar object_holder_definalize PLUGINSERVICE
/forge-1.15.2-31.1.17.jar runtime_enum_extender PLUGINSERVICE
/accesstransformers-2.0.3-shadowed.jar accesstransformer PLUGINSERVICE
/forge-1.15.2-31.1.17.jar capability_inject_definalize PLUGINSERVICE
/forge-1.15.2-31.1.17.jar runtimedistcleaner PLUGINSERVICE
/forge-1.15.2-31.1.17.jar fml TRANSFORMATIONSERVICE
FML: 31.1
Forge: net.minecraftforge:31.1.17
FML Language Providers:
[email protected]
minecraft@1
[email protected]
Mod List:
blood-particles-1.15.2-v1.0.0.jar Blood Particles {[email protected] DONE}
AdditionalEnchantedMiner-1.15.1-15.2.0.jar QuarryPlus {[email protected] DONE}
techemistry-1.15.2-2.jar Techemistry {[email protected] DONE}
prefab-1.5.0.0.jar Prefab {[email protected] DONE}
SilentMechanisms-1.15.2-0.7.0+50.jar Silent's Mechanisms {[email protected]+50 DONE}
Industrial+Agriculture[Core]-1.15.2-1.6.4.jar Industrial Agriculture {[email protected] DONE}
IronJetpacks-1.15.2-3.0.0.jar Iron Jetpacks {[email protected] DONE}
essentials-1.15.2-2.7.0.jar Essentials {[email protected] DONE}
ForgeEndertech-1.15.2-6.0.0.0-build.0004.jar Forge Endertech {[email protected] DONE}
TerraForged-1.15.2-0.0.3.jar TerraForged {[email protected] DONE}
Placebo-1.15.2-3.0.2.jar Placebo {[email protected] DONE}
Powah-1.15.2-1.1.5.jar Powah {[email protected] DONE}
NomadicTents-1.15.2-11.0.0-beta.jar Nomadic Tents {[email protected] DONE}
MutantBeasts-1.15.2-1.0.1.jar Mutant Beasts {[email protected] DONE}
Bookshelf-1.15.2-5.1.4.jar Bookshelf {[email protected] DONE}
guardvillagers-1.15.2-1.0.0.jar Guard Villagers {[email protected] DONE}
DarkUtilities-1.15.2-3.0.1.jar Dark Utilities {[email protected] DONE}
MekanismGenerators-1.15.2-9.9.6.397.jar Mekanism: Generators {[email protected] DONE}
VampiresNeedUmbrellas-1.15.2-1.0.jar Vampires Need Umbrellas {[email protected] DONE}
MysticalAgradditions-1.15.2-3.0.0.jar Mystical Agradditions {[email protected] DONE}
refinedstorage-1.8.1.jar Refined Storage {[email protected] DONE}
industrial-foregoing-1.15.2-2.2.1-f27c515.jar Industrial Foregoing {[email protected] DONE}
improved-stations-1.0.jar Improved Stations {[email protected] DONE}
Lollipop-1.15.2-1.0.7.jar Lollipop {[email protected] DONE}
mining_dimension-1.15.2-1.0.1.jar Mining World {[email protected] DONE}
SilentGear-1.15.2-1.5.0+74.jar Silent Gear {[email protected]+74 DONE}
ferroustry-2.2.jar Ferroustry {[email protected] DONE}
Patchouli-1.15.2-1.2-27.jar Patchouli {[email protected] DONE}
corail_woodcutter-1.1.1-1.15.2.jar Corail Woodcutter {[email protected] DONE}
SurvivalPlus-1.15.2-0.1.2.jar SurvivalPlus {[email protected] DONE}
ProjectE-1.15.2-PE1.0.2B.jar ProjectE {[email protected] DONE}
BiomesOPlenty-1.15.2-10.0.0.345-universal.jar Biomes O' Plenty {[email protected] DONE}
f2l-0.3.1.jar Flesh 2 Leather {[email protected] DONE}
libnonymous-1.15.2-1.1.1.5.jar Libnonymous {[email protected] DONE}
tombstone-4.2.0-1.15.1.jar Corail Tombstone {[email protected] DONE}
obfuscate-0.3.4-1.15.2.jar Obfuscate {[email protected] DONE}
vehicle-mod-0.42.6-1.15.2.jar MrCrayfish's Vehicle Mod {[email protected] DONE}
Marker-4.0.jar FlexibleMarker {[email protected] DONE}
AttainedDrops-1.15.2-6.0.3.jar Attained Drops {[email protected] DONE}
MekanismTools-1.15.2-9.9.6.397.jar Mekanism: Tools {[email protected] DONE}
furniture-7.0.0-pre16-1.15.1.jar MrCrayfish's Furniture Mod {[email protected] DONE}
Zmod+1.15.2-1.04.jar ZmodSkills {[email protected] DONE}
CobbleForDays-1.1.1.jar Cobble For Days {[email protected] DONE}
Cyclic-1.15.2-0.1.11.jar Cyclic {[email protected] DONE}
redstonefurnaces-1.1.jar Redstone Furnaces {[email protected] DONE}
infinitewatersource-4.0.jar Infinite Water Source {[email protected] DONE}
Cucumber-1.15.2-3.0.1.jar Cucumber Library {[email protected] DONE}
mining-helmet-1.15.2-1.0.6.jar Mining Helmet {[email protected] DONE}
jei-1.15.2-6.0.0.2.jar Just Enough Items {[email protected] DONE}
longfallboots-1.4.0b.jar Long Fall Boots {[email protected] DONE}
FallingTree-1.15.2-2.0.3+19.jar Falling Tree {[email protected]+19 DONE}
goblintraders-1.2.0-1.15.2.jar Goblin Traders {[email protected] DONE}
Mekanism-1.15.2-9.9.6.397.jar Mekanism {[email protected] DONE}
reap-1.12.0.jar Reap Mod {[email protected] DONE}
journeymap-1.15.2-5.7.0beta1.jar Journeymap {[email protected] DONE}
FruitTrees-1.15.2-1.1.5.jar Fruit Trees {[email protected] DONE}
Kiwi-1.15.2-2.6.5.jar Kiwi {[email protected] DONE}
SimpleStorageNetwork-1.15.2-0.2.4 (1).jar Simple Storage Network {[email protected] DONE}
SereneSeasons-1.15.2-3.0.0.66-universal.jar Serene Seasons {[email protected] DONE}
cursedearth-2.1.jar Cursed Earth {[email protected] DONE}
BotanyPots-1.15.2-2.0.1.jar BotanyPots {[email protected] DONE}
AdHooks-1.15.2-5.0.0.0-build.0004.jar Advanced Hook Launchers {[email protected] DONE}
engineerstools-1.15.2-1.0.6.jar Engineer's Tools {[email protected] DONE}
FarmingForBlockheads_1.15.2-6.1.0.jar Farming for Blockheads {[email protected] DONE}
BonsaiTrees-2.1.2.6.jar Bonsai Trees 2 {[email protected] DONE}
alib-1.15.2-1.jar A Lib {[email protected] DONE}
mcjtylib-1.15-4.0.2-alpha.jar McJtyLib {[email protected] DONE}
PackingTape-1.15.2-0.9.5.jar Packing Tape {[email protected] DONE}
infinityworkswithallarrows-1.0.jar Infinity works with all arrows {[email protected] DONE}
mininggadgets-1.3.1.jar Mining Gadgets {[email protected] DONE}
endercompass-2.0.jar Ender Compass {[email protected] DONE}
CraftTweaker-1.15.1-6.0.0.3.jar CraftTweaker {[email protected] DONE}
extradisks-1.15.1-1.2.jar Extra Disks {[email protected] DONE}
treegrower-1.15.2-1.06.jar treegrower {[email protected] DONE}
campfiretorches-1.15.2-1.0.2.jar Campfire Torches {[email protected] DONE}
forge-1.15.2-31.1.17-universal.jar Forge {[email protected] DONE}
MysticalAgriculture-1.15.2-3.0.0.jar Mystical Agriculture {[email protected] DONE}
alchemistry-1.15.2-5.jar Alchemistry {[email protected] DONE}
forge-1.15.2-31.1.17-client.jar Minecraft {[email protected] DONE}
cofh_core-1.15.2-0.3.1b.jar CoFH Core {[email protected] DONE}
titanium-1.15.2-2.3.6.jar Titanium {[email protected] DONE}
SilentLib-1.15.2-4.6.0+48.jar Silent Lib {[email protected]+48 DONE}
beesknees-1.15.2-1.0.1.jar The Bees Knees Mod {beesknees@1 DONE}
AdLods-1.15.2-3.0.0.0-build.0004.jar Large Ore Deposits {[email protected] DONE}
archers_paradox-1.15.2-0.3.0b.jar Archer's Paradox {[email protected] DONE}
LargeFluidTank-15.2.1.jar FluidTank {[email protected] DONE}
car-1.15.2-2.0.2.jar Ultimate Car Mod {[email protected] DONE}
extragolems-10.0.0-beta.jar Extra Golems {[email protected] DONE}
dimdungeons-1.04-forge-1.15.2.jar Dimensional Dungeons {[email protected] DONE}
flux-4.8.6.jar Flux {[email protected] DONE}
fl-3.0.11.jar Flux Library {[email protected] DONE}
chemlib-1.15.2-2.jar Chem Lib {[email protected] DONE}
corail_recycler-4.0.2-1.15.2.jar Corail Recycler {[email protected] DONE}
backpacked-1.4.1-1.15.2.jar Backpacked {[email protected] DONE}
structurize-0.10.223-ALPHA.jar Structurize {[email protected] DONE}
minecolonies-0.10.660-ALPHA-universal.jar Minecolonies {[email protected] DONE}
Vampirism-1.15.2-1.6.0-alpha+20200228-0048.jar Vampirism {[email protected]+20200228-0038 DONE, [email protected]+20200228-0038 DONE}
engineersdecor-1.15.2-1.0.19-b5.jar Engineer's Decor {[email protected] DONE}
moredragoneggs-1.0.jar More Dragon Eggs {[email protected] DONE}
SilentGems-1.15.2-3.5.0+83.jar Silent's Gems 3 {[email protected]+83 DONE}
XL-Food-Mod-1.15.2-2.2.2.jar XL Food Mod {[email protected] DONE}
waterworks-1.15.2-2.0.1.jar Waterworks {[email protected] DONE}
Industrial+Agriculture[Mekanism]-1.15.2-1.5.1.jar Industrial Agriculture Plugin-Mekanism {[email protected] DONE}
ElementaryOres-1.15.2-1.0.0.jar Elementary Ores {[email protected] DONE}
refinedstorageaddons-0.6.1.jar Refined Storage Addons {[email protected] DONE}
healingcf_1.15.2-1.7.jar Healing Campfire {[email protected] DONE}
Omega+Craft+4.0.9+-+1.15.2.jar Omega Craft {[email protected] DONE}
Mubble-3.0.1-(Forge-1.15.2).jar Mubble {[email protected] DONE}
farlanders-1.15.2-1.1.2.jar The Farlanders {[email protected] DONE}
Kiwi Modules:
fruittrees:fruittrees
kiwi:contributors
Player Count: 1 / 8; [ServerPlayerEntity['1996pilot'/416, l='MO DO', x=367.39, y=47.00, z=-189.57]]
Data Packs: vanilla, mod:adhooks (incompatible), mod:adlods (incompatible), mod:alchemistry (incompatible), mod:alib, mod:archers_paradox (incompatible), mod:attained_drops (incompatible), mod:backpacked (incompatible), mod:beesknees (incompatible), mod:biomesoplenty, mod:blood_particles, mod:bonsaitrees2, mod:bookshelf (incompatible), mod:campfiretorches, mod:car, mod:cfm (incompatible), mod:chemlib (incompatible), mod:cobblefordays (incompatible), mod:cofh_core (incompatible), mod:corail_recycler, mod:corail_woodcutter, mod:crafttweaker (incompatible), mod:cucumber, mod:cyclic (incompatible), mod:darkutils (incompatible), mod:dimdungeons, mod:elementaryores (incompatible), mod:endercompass (incompatible), mod:engineersdecor, mod:engineerstools, mod:essentials (incompatible), mod:extradisks, mod:f2l, mod:falling_tree, mod:farlanders (incompatible), mod:farmingforblockheads (incompatible), mod:ferroustry (incompatible), mod:fl, mod:flexiblemarker, mod:fluidtank, mod:flux, mod:forge (incompatible), mod:forgeendertech (incompatible), mod:fruittrees, mod:goblintraders, mod:golems (incompatible), mod:guardvillagers (incompatible), mod:iapmekanism, mod:improved-stations (incompatible), mod:industrialagriculture, mod:industrialforegoing (incompatible), mod:ironjetpacks, mod:jei (incompatible), mod:kiwi, mod:libnonymous (incompatible), mod:lollipop (incompatible), mod:mcjtylib (incompatible), mod:mekanism, mod:mekanismgenerators, mod:mekanismtools, mod:minecolonies (incompatible), mod:mining_helmet (incompatible), mod:moredragoneggs, mod:mubble, mod:mysticalagradditions, mod:mysticalagriculture, mod:obfuscate (incompatible), mod:omegacraft (incompatible), mod:packingtape, mod:patchouli (incompatible), mod:placebo (incompatible), mod:powah (incompatible), mod:prefab, mod:projecte, mod:quarryplus, mod:reap, mod:refinedstorage (incompatible), mod:refinedstorageaddons (incompatible), mod:sereneseasons, mod:silentgear (incompatible), mod:silentgems (incompatible), mod:silentlib (incompatible), mod:silents_mechanisms (incompatible), mod:storagenetwork (incompatible), mod:structurize (incompatible), mod:survivalplus, mod:techemistry (incompatible), mod:titanium (incompatible), mod:tombstone, mod:treegrower, mod:vampirism (incompatible), mod:vehicle (incompatible), mod:waterworks (incompatible), mod:xlfoodmod, mod:zmod, mod:botanypots (incompatible), mod:healingcf (incompatible), mod:journeymap (incompatible), mod:mining_dimension, mod:mininggadgets (incompatible), mod:mutantbeasts (incompatible), mod:nomadictents (incompatible), mod:terraforged, mod:longfallboots (incompatible), mod:cursedearth (incompatible), mod:infinitewatersource (incompatible), mod:infinityworkswithallarrows (incompatible), mod:redstonefurnaces (incompatible), mod:vampiresneedumbrellas (incompatible)
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge'
Still pretty sure it does not fix the issue as the Dist is completely unrelated to the thread or logical side which causes the IllegalState expection/ Thread check.
https://mcforge.readthedocs.io/en/latest/concepts/sides/#distexecutor
But since I did not have the original issue (or use this mod) I cannot test it. Just wanted to let you know
To be honest, I am not sure if this actually resolves the issue.
The OnlyIn(Dist.Client)
will have no affect on single player games with the integrated server.
That method can and will still be called on the server thread of the single player client/integrated server and therefore could still cause a "Not on render thread exception"
I get the same crash, but I do not have Vampirism installed. The crash occured as soon as I tried to remove the Virtual Goggle from my helmet slot.
Mubble v3.0.3
Crash Log
It sounds like you are right, @maxanier. I'll look further into this this next week-end