Skip to content

Fix truncated Lua error reports that cut out the error - #3077

Open
moss-orbit-9f339e wants to merge 3 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:crashreport-keep-lua-error
Open

moss-orbit-9f339e wants to merge 3 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:crashreport-keep-lua-error

Conversation

@moss-orbit-9f339e

@moss-orbit-9f339e moss-orbit-9f339e commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Lua error reports on ZeroK-RTS/CrashReports usually do not show the Lua error. The launcher cuts the infolog to 62000 characters and keeps only the start, the end and the first desync of each game, so the Lua error line (LUA_ERRRUN, LUA_ERRMEM, ...) in the middle is removed. Of the 40 newest LuaError reports (2026-11-14 to 2026-11-19), 39 do not contain it.

The fix adds the first LUA_ERR line (any Lua error type, as sprunk suggested) as one more place to keep, with the text around it. The start and the end of the log then get less of the 62000 characters.

I copied the truncation code unchanged from master and from this branch into a small program and ran it under Mono with 14 synthetic infologs. In the 8 long logs that have a Lua error in the middle, master drops the error and the branch keeps it with its stack traceback and about 10000 to 15000 characters on each side. Logs without a Lua error give the same output as master, desync lines are still kept, and all outputs are below 62000 characters.

Fixes #2511

Written entirely by Claude Code.

🤖 Generated with Claude Code

Crash reports cut the infolog to 62000 characters. The truncation kept the
start and end of the log and the first desync of each game, so the
LUA_ERRRUN line of a Lua error report was usually cut out. Add the first
LUA_ERRRUN (the same string that marks a report as LuaError) as a point of
interest, so its lines and the text around it are kept.

Fixes ZeroK-RTS#2511

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread ChobbyLauncher/CrashReportHelper.cs Resolved
Follow sprunk's review: search for the first LUA_ERR instead of the first
LUA_ERRRUN, so a LUA_ERRMEM error (which often comes before a desync when
synced Lua hits the memory limit) is also kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread ChobbyLauncher/CrashReportHelper.cs Resolved
@Licho1
Licho1 enabled auto-merge (squash) November 23, 2026 11:16
@Licho1
Licho1 disabled auto-merge November 23, 2026 11:16
@Licho1
Licho1 enabled auto-merge (squash) November 23, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make lua error reports useful

3 participants