-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash crafting using proxy on bedrock servers #515
Comments
Can you reproduce this on another server or a vanilla server? |
Yes, when using the standard bedrock server from minecraft.net still get the same crash, even in creative mode adding items to inventory:
C:\bedrock\node_modules\protodef\src\compiler.js:114
throw e
^
Error: Read error for undefined : array size is abnormally large, not reading: 16777216
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:342:37)
at Object.ItemExtraDataWithoutBlockingTick (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:351:9)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:386:47)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:388:17)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:390:13)
at Object.ItemLegacy (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:392:9)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1606:48)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1611:17)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1614:13)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1616:11)
Node.js v18.20.4
I can get the proxy working again if I downgrade the minecraft-data package from 3.67.0 to 3.66.0 however I am limited to using the 1.20.80 and older client as if I upgrade to 1.21.2 I get a “Error: Unsupported version 1.21.2”. Updating minecraft-data to 3.67.0 causes the crash in all client versions.
|
The work around is to downgrade minecraft-data package to 3.66.0. Go to https://github.com/PrismarineJS/minecraft-data/releases and download the minecraft-data-3.66.0.zip file. Extract to node_modules\minecraft-data\minecraft-data. You will be limited to the 1.21.0 client and older as newer clients require minecraft-data 3.67.0 which causes the issue in all client versions. |
Can you please set |
This is the code: Error.stackTraceLimit = Infinity Client is version 1.20.81 and server from minecraft.net is version 1.20.81.01 This is the output after the crash adding any item to inventory: New connection 10.10.0.10/55385 Error: Read error for undefined : array size is abnormally large, not reading: 16777216 Node.js v20.16.0 |
OK, please add some logging like this: const fs = require('fs')
relay.on('connect', (player) => {
const file = fs.createWriteStream('log.txt')
player.downInLog = function (...e) {
file.write(JSON.stringify(e) + '\n')
}
}) and provide the log.txt file (either here or or http://gist.github.com). That should contain needed packet buffer information. |
Sorry program simply exits when I connect and does not create any log file. This is what I'm using: Error.stackTraceLimit = Infinity |
This is the log: This is the code I'm using: BigInt.prototype.toJSON = function() { return this.toString() } relay.on('connect', (player) => { const file = fs.createWriteStream('log.txt') I had to add the first line to resolve a "TypeError: Do not know how to serialize a BigInt" |
You can pick up items, take items from chests, and use /give command with no crash. Crash happens when crafting an item on crafting table or adding item to inventory from creative mode. |
Looking into the crafting issue, seems a bit odd that the buffer is using craft_creative as opposed to auto which was updated. I can separately confirm the issue with the movement correction packet, that is missing a field since 1.20.80. |
Ah wow, crafting issue seems to be caused by a bug in protodef compiler's codegen. Anonymous containers with switches have bad code generation. |
Will be fixed by ProtoDef-io/node-protodef#159 |
Would be great if people could test out the above PR. |
Movement correction issue fixed upstream with #522. But again if anyone could test above PR in ProtoDef that would be great. |
Exactly how to I apply the fix? A fresh install using "npm install bedrock-protocol" and using vanilla 1.20.81 client and server still crashes crafting or adding to inventory in creative mode. Update: running a "npm install protodef" updates the code with the fix (installing just bedrock-protocol puts an older version) and also had to run a "npm install minecraft-data" to add support for newer versions. Crafting seems to function normally on 1.21.30 now. |
Get the below crash crafting anything on Bedrock servers when connected with proxy. Tried 1.20.80 and 1.21.2 clients, even when using basic proxy script example code:
C:\bedrock\node_modules\protodef\src\compiler.js:114
throw e
^
Error: Read error for undefined : array size is abnormally large, not reading: 16777216
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :342:37)
at Object.ItemExtraDataWithoutBlockingTick (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :351:9)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :386:47)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :388:17)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :390:13)
at Object.ItemLegacy (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :392:9)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :1577:48)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :1582:17)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :1585:13)
at eval (eval at compile (C:\bedrock\node_modules\protodef\src\compiler.js:258:12), :1587:11)
Node.js v18.20.4
The text was updated successfully, but these errors were encountered: