crash - String too long for serializeString

Post Reply
loosewheel
New member
Posts: 8
Joined: Mon Dec 28, 2020 01:19
In-game: loosewheel

crash - String too long for serializeString

by loosewheel » Post

Game was hosted over LAN.

Crash occurred when the item was dropped (Q key).

When dropped in host machine:

Code: Select all

2021-02-22 13:48:44: ACTION[Server]: loosewheel uses lwcomputers:book, pointing at [nothing]
2021-02-22 13:48:50: ERROR[Server]: An unhandled exception occurred: String too long for serializeString
2021-02-22 13:48:50: ERROR[Server]: In thread 7f11597d7700:
2021-02-22 13:48:50: ERROR[Server]: /build/minetest-2HALFv/minetest-5.3.0/src/server.cpp:7d: virtual void* ServerThread::run(): A fatal error occurred: String too long for serializeString
When dropped in client machine, which crashes the host:

Code: Select all

2021-02-22 13:38:31: ACTION[Server]: mary uses lwcomputers:book, pointing at [nothing]
2021-02-22 13:38:31: WARNING[ConnectionSend]: con(18/1) Packet quota used up for peer_id=3, was 512 pkts
2021-02-22 13:38:32: WARNING[ConnectionSend]: con(18/1) Packet quota used up for peer_id=3, was 512 pkts
2021-02-22 13:38:32: WARNING[ConnectionSend]: con(18/1) Packet quota used up for peer_id=3, was 512 pkts
2021-02-22 13:38:34: WARNING[ConnectionSend]: con(18/1) Packet quota used up for peer_id=3, was 512 pkts
2021-02-22 13:38:39: ERROR[Server]: An unhandled exception occurred: String too long for serializeString
2021-02-22 13:38:39: ERROR[Server]: In thread 7fc4773ee700:
2021-02-22 13:38:39: ERROR[Server]: /build/minetest-2HALFv/minetest-5.3.0/src/server.cpp:7d: virtual void* ServerThread::run(): A fatal error occurred: String too long for serializeString
The item contains a lengthy string in its meta data.

Is there a work around/fix/setting for this, or is this a hard limit? What is the limit (how big is 512 pkts)?

User avatar
AiTechEye
Member
Posts: 917
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: ¯\_(ツ)_/¯

Re: crash - String too long for serializeString

by AiTechEye » Post

i think its a hard limit, about 65000 characters, i also got this trouble, my workaround was to replace patterns to make the string shorter, eg if the string contains lots of ".png" you could repalce it with "!" then reverse when the string is used.

User avatar
Krock
Developer
Posts: 4587
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: crash - String too long for serializeString

by Krock » Post

https://github.com/minetest/minetest/issues/10981

Please run your game in "gdb" (Linux) or "windbg" (Windows) and reproduce the crash. Alternatively upload a world to properly reproduce it.

PS: You can ignore the "Packet quota used up" messages as long no players disconnect at random.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

loosewheel
New member
Posts: 8
Joined: Mon Dec 28, 2020 01:19
In-game: loosewheel

Re: crash - String too long for serializeString

by loosewheel » Post

@AiTechEye, I byte encoded the book data instead of using a serialised table. I can get a max of 5 pages. I seem to be able to put about 12kb in the metadata before this error occurs. The items that have disk space are way to big to reduce. I store the disk data in a file from the on_drop handler, and overrode the minetest.registered_entities["__builtin:item"].on_punch handler to put it back in the item when the item is picked up. This seems to work, but I think I’ll simplify the mechanism to use it with other items too.

loosewheel
New member
Posts: 8
Joined: Mon Dec 28, 2020 01:19
In-game: loosewheel

Re: crash - String too long for serializeString

by loosewheel » Post

@Krock here is the output from gdb:
+ gdb output
I think the offender is here, file server.c, line 93. Line 7d (125) is the END_DEBUG_EXCEPTION_HANDLER macro.
+ code
It appears that when an item is dropped the item is converted to a string and sent to the server. When the string is larger than a certain size this causes the exception. The minetest.registered_entities["__builtin:item"].on_punch deals with the item as a string, including its metadata.

User avatar
hex
Member
Posts: 50
Joined: Sun Dec 06, 2020 04:22
IRC: hecks
In-game: hex hhhehehe

Re: crash - String too long for serializeString

by hex » Post

Never mind that a client has no business sending meta in the first place, but does the server just blindly believe whatever the client stuffs in there? How does this work?

User avatar
sfan5
Moderator
Posts: 3961
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: crash - String too long for serializeString

by sfan5 » Post

This isn't the client sending meta, it's the server encountering an error upon trying to send more than 64k characters from somewhere in the in-game environment. Mods should take care not to store huge amounts of data inside item metadata.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests