[Twinsen][1.1.109][switch] Crash when focusing on a script created text-box longer than 512 chars

This subforum contains all the issues which we already resolved.
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

[Twinsen][1.1.109][switch] Crash when focusing on a script created text-box longer than 512 chars

Post by chrisgbk »

Hard crash, completely closes.

Following minimal scenario was hosted on PC server and connected to with switch (see attachment for zip version to extract to scenarios folder):

Code: Select all

script.on_event(defines.events.on_player_joined_game, function(e)
    local player = game.players[e.player_index]
	local edit = player.gui.center.add{type = 'text-box'}
	edit.word_wrap = true
	edit.style.width = 600
	edit.style.height = 200
	edit.text = string.rep('a', 480) .. '\n\nclick to crash switch (not pc)\n\n'
end)
Smaller strings are fine, only >512 character strings cause an issue, possibly a buffer overflow.
Attachments
Switch-bug.zip
(549 Bytes) Downloaded 35 times
Twinsen
Factorio Staff
Factorio Staff
Posts: 1376
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [Twinsen][1.1.109][switch] Crash when focusing on a script created text-box longer than 512 chars

Post by Twinsen »

Thanks for the detailed report.
This is a limitation of the Nintendo Switch on-screen keyboard.
I fixed it by truncating the string to the maximum allowed length(only 500) when using the keyboard. Not ideal but better than not allowing it to be edited at all.
Fixed for Version: 2.0.30
Post Reply

Return to “Resolved Problems and Bugs”