Netty io issue (no crash) mc 1-12-2 sonarcore-1.12.2-5.0.2 and forge-1.12.2-14.23.0.2540
trogarus opened this issue ยท 10 comments
Looks like forge shuffling bits around again
[06:27:36] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1086) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1394) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.readLong(AbstractByteBuf.java:792) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at sonar.core.network.sync.SyncEnergyStorage.readFromBuf(SyncEnergyStorage.java:111) ~[SyncEnergyStorage.class:?]
at sonar.flux.common.tileentity.TileEntityStorage.readPacket(TileEntityStorage.java:141) ~[TileEntityStorage.class:?]
at sonar.core.network.PacketByteBuf$Handler.lambda$processMessage$0(PacketByteBuf.java:64) ~[PacketByteBuf$Handler.class:?]
at sonar.core.network.PacketByteBuf$Handler$$Lambda$2696/1355253329.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 9 more
[06:27:37] [main/INFO]: Loaded 799 advancements
[06:27:37] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1086) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1394) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.readLong(AbstractByteBuf.java:792) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at sonar.core.network.sync.SyncEnergyStorage.readFromBuf(SyncEnergyStorage.java:111) ~[SyncEnergyStorage.class:?]
at sonar.flux.common.tileentity.TileEntityStorage.readPacket(TileEntityStorage.java:141) ~[TileEntityStorage.class:?]
at sonar.core.network.PacketByteBuf$Handler.lambda$processMessage$0(PacketByteBuf.java:64) ~[PacketByteBuf$Handler.class:?]
at sonar.core.network.PacketByteBuf$Handler$$Lambda$2696/1355253329.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 9 more
[06:27:37] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1086) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1394) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.readLong(AbstractByteBuf.java:792) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at sonar.core.network.sync.SyncEnergyStorage.readFromBuf(SyncEnergyStorage.java:111) ~[SyncEnergyStorage.class:?]
at sonar.flux.common.tileentity.TileEntityStorage.readPacket(TileEntityStorage.java:141) ~[TileEntityStorage.class:?]
at sonar.core.network.PacketByteBuf$Handler.lambda$processMessage$0(PacketByteBuf.java:64) ~[PacketByteBuf$Handler.class:?]
at sonar.core.network.PacketByteBuf$Handler$$Lambda$2696/1355253329.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 9 more
[06:27:37] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1086) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1394) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.readLong(AbstractByteBuf.java:792) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at sonar.core.network.sync.SyncEnergyStorage.readFromBuf(SyncEnergyStorage.java:111) ~[SyncEnergyStorage.class:?]
at sonar.flux.common.tileentity.TileEntityStorage.readPacket(TileEntityStorage.java:141) ~[TileEntityStorage.class:?]
at sonar.core.network.PacketByteBuf$Handler.lambda$processMessage$0(PacketByteBuf.java:64) ~[PacketByteBuf$Handler.class:?]
at sonar.core.network.PacketByteBuf$Handler$$Lambda$2696/1355253329.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 9 more
[06:27:37] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1086) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1394) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at io.netty.buffer.AbstractByteBuf.readLong(AbstractByteBuf.java:792) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
at sonar.core.network.sync.SyncEnergyStorage.readFromBuf(SyncEnergyStorage.java:111) ~[SyncEnergyStorage.class:?]
at sonar.flux.common.tileentity.TileEntityStorage.readPacket(TileEntityStorage.java:141) ~[TileEntityStorage.class:?]
at sonar.core.network.PacketByteBuf$Handler.lambda$processMessage$0(PacketByteBuf.java:64) ~[PacketByteBuf$Handler.class:?]
at sonar.core.network.PacketByteBuf$Handler$$Lambda$2696/1355253329.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 9 more
Sorry to say, it's a personally built modpack, not done through twitch. All files were manually downloaded to create the custom pack I created to play. Vanilla minecraft launcher is also what is used to play the pack.
And after updating a few other mods like backpacks, which had similar issues, and running with 2540 again, it seems like the issue is gone. Will let this set a day or two yet to report back if there are any other issues.
Side note, switching dimensions, for some reason, still creates a bounce out, but at least now the netty issue that was preventing logging back into the save game is no longer issue. It bounces me, but I can log right back in now. Time to look other places for what's causing the bounce, and no log notations to help figure it out either.
To be clear, this is creating a bounce back to server list loop where game worlds CANNOT be entered because of the issue. Although there is no crash, it effectively renders the world unplayable.
If you have an IMessage
implementation that keeps a reference to the ByteBuf
given in fromBytes
, you need to handle the reference counts correctly.
You need a call to retain()
here, so the buffer isn't freed prematurely:
@Override
public void fromBytes(ByteBuf buf) {
super.fromBytes(buf);
this.id = buf.readInt();
this.buf = buf.retain();
}
And you need to release()
the buffer after your packet handler finishes:
@Override
public IMessage processMessage(EntityPlayer player, MessageContext ctx, PacketByteBuf message, TileEntity tile) {
SonarCore.proxy.getThreadListener(ctx).addScheduledTask(() -> {
if (tile instanceof IByteBufTile) {
IByteBufTile packet = (IByteBufTile) tile;
packet.readPacket(message.buf, message.id);
}
/* else { TileHandler handler = OLDMultipartHelper.getHandler(tile); if (handler != null && handler instanceof IByteBufTile) { ((IByteBufTile) handler).readPacket(message.buf, message.id); } } */
message.buf.release()
});
return null;
}
So I see this too - the application logs this /constantly/ in the background - see for example
2017-11-26-3.log.gz.
That's 3.46MB of gzipped log, >500MB of raw log, the vast majority of which is this error looping constantly.
As evidenced by the above, this doesnt' seem to kill the game (in single player), but it does cause an inordinate amount of logging.
I'll try shuffling other mods' versions around too, but it would be much appreciated if there were anything that could be done to mitigate this on Sonar Core's side (this exception appears to be being triggered by Flux Networks).
In the above log I was running a -DEV
version of one mod. I swapped it out to ensure I was running on pure Modern Skyblock 2 (and all items/blocks from that instance were deleted) and the error still exists - just heading that off.
I also just noticed, even with forge 2555 (which now again crashes the game to server login again) that the controller also does NOT keep settings visually. However, it does seem to continue transferring energy despite saying that there is no transfer.
Also, ZERO crash log for this issue, just a game bounce back to server list even though I was never on a server and playing locally and no LAN open either.
Full log
fml-client-latest.log
yes there is no crash because only the server thread is failing during syncing to the client thread causing the connection to the integrated server for the singleplayer world to be lost