Skip to content
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

[Bug]: GS appears to be able to hang the game in Story Book #11226

Open
andythenorth opened this issue Aug 23, 2023 · 4 comments
Open

[Bug]: GS appears to be able to hang the game in Story Book #11226

andythenorth opened this issue Aug 23, 2023 · 4 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) component: interface This is an interface issue

Comments

@andythenorth
Copy link
Contributor

andythenorth commented Aug 23, 2023

Version of OpenTTD

Local build of #11141

Expected result

No hang, or crash handling is invoked.

Actual result

Hang (spinning) for me on macOS, with 100% CPU core use, but crash handling is not triggered.

Steps to reproduce

Attached zip contains FIRS GS, FIRS grf, and savegame.

  1. Open Story Book and look at "Grind: Persistent Storage - [foo]" pages.
image
  1. Close Story Book.

  2. Open GS Settings, and turn "Show Grind pages in story book" off and on again.

image
  1. Re-open Story Book and try the "Grind: Persistent Storage - [foo]" pages again. This produces a hang (spinning) for me on macOS, with 100% CPU core use, but crash handling is not triggered.

Test GS spin.zip

-- Comments --

  1. The GS does recursion without limit in some _Repr classes such as PrettyPrintTable (see repr.nut). This might be stupid.
  2. It might be that too many elements are being added to the Story Book, or that Story Book is just very slow to render. I have had other cases where this hasn't crashed, but game FPS is noticeably reduced.
  3. There might be just be a clown shoes error elsewhere in my GS. I'm trying to write my own debugger here, but debugging it without a debugger relies on having the right logging in place in anticipation.
@andythenorth andythenorth changed the title [Bug]: GS appears to be able to spin the game in Story Book [Bug]: GS appears to be able to hang the game in Story Book Aug 23, 2023
@JGRennison
Copy link
Contributor

JGRennison commented Aug 23, 2023

Screenshot_2023-08-23_19-35-17
The performance cost seems to mostly be in FormatString and the associated std::string back inserter

@glx22
Copy link
Contributor

glx22 commented Aug 24, 2023

Your strings are 2900+ chars long, and you put more than 100 of them in this window.

@LordAro
Copy link
Member

LordAro commented Aug 25, 2023

Even so, might be worth looking into improving performance...
2900x100 isn't that much in the grand scheme of things

@TrueBrain
Copy link
Member

300KiB of text in a screen meant for a human to read .. pretty sure this falls outside of the reasonable bounds :)

Not disagreeing that improving performance is good, but resolving this ticket shouldn't be the goal / benchmark, imo. This is just abusing the system for unrelated things :D

@2TallTyler 2TallTyler added component: interface This is an interface issue component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) component: interface This is an interface issue
Projects
None yet
Development

No branches or pull requests

6 participants