fix(build): the crash window copies log lines by a name the MSVC target links (no "undefined symbol: strdup") #1379
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1379
Loading…
Reference in a new issue
No description provided.
Delete branch "GummiNaomi/Longshot:fix/crash-dialog-strdup-msvc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Windows 11, clang for the MSVC target (the emsdk's clang, a Windows SDK without
oldnames.lib); the Test Farm's builds: Windows (RX 9070 XT), Linux (RADV RX 7900 XT, RTX 3080 Ti) · Needs: nothingWhy
Since #983, a Windows build for the MSVC target stops at the link, after the whole game has been translated and compiled:
The crash window's report reads the log again and copies its lines with
strdup(host/hos_crash_dialog.c,lines_addandcrash_lines). The MSVC target links withoutoldnames.lib(issue 439: recent Windows SDKs no longer ship it), and without it the C runtime has that function only as_strdup.third_party/a64-kit/tools/toolchain.pysays so where it leaves the library out: "The game and host use no legacy non-underscore name". The llvm-mingw and Linux builds have the plain name, so they kept building and nothing caught it.How to reproduce
Seen on: Windows 11, a build for the MSVC target (
LONGSHOT_MINGWnot set: clang with lld-link, a Windows SDK that has nooldnames.lib); no GPU involvedSettings and switches: defaults
Steps:
python -I nx2/make_game.py --nup <the dump> --out <a game folder>on main @8e9cfc3a,6d72ca93or544229a2Expected: the game folder is built
Actual:
link FAILED (2s), 1 undefined symbols,lld-link: error: undefined symbol: strdup, after the translation and the compileWhat changed
The two copies go by the name each C runtime links:
_strdupon Windows,strdupelsewhere.line_copyinhost/hos_crash_dialog.c, used bylines_addandcrash_lines.tests/test_msvc_oldnames.pyreads the host's sources (host/*.c,host/*.h) for the legacy names onlyoldnames.libgave (strdup,stricmp,unlink,getcwdand so on; not the oneshost/msvc_oldnames.caliases) and fails on a call the Windows build compiles: one that is not under#ifndef _WIN32, in the#elseof an#ifdef _WIN32chain, or in another system's section. Comments, strings, members (x.unlink() and names a file defines for itself are left alone. A second test checks that scan on a small made-up source.Measurements
Nothing to measure: a link error, and the same call on the builds that linked.
Flags and settings
None.
Testing
Tested: Windows 11, the MSVC target (emsdk clang, lld-link): main @
8e9cfc3a(and6d72ca93) stops atundefined symbol: strdup; with this change the same builds link, as does main @544229a2, and the game ran the scripted market and area-change routes on them (about sixty runs of 95-105 s, for other work).tests/test_msvc_oldnames.pypasses; withhost/hos_crash_dialog.cput back to main's it fails and nameshost/hos_crash_dialog.c:1232 strdupand:1255 strdup, and nothing else in the host.tests/test_crash_dialog.py --cxx clang++compiles and links the crash window with the change and fails later at its "quote" check here, the same as on main on this PC.python -I -B tests/run_all.pywith clang here, this PR @65945ab4: 393 passed, 107 failed, 221 skipped; main @544229a2in the same session: 392 passed, 108 failed, 221 skipped. Nothing fails here that does not fail on main (this PC's toolchain: no gcc, Windows line endings, fixtures needing tools not installed); the one more on main wastests/test_gpu_hang_watch.pyin that run.The Test Farm built this PR @
65945aband started the game, against main @544229a: on Windows (RX 9070 XT, 2.0.416) and on two Linux PCs (RX 7900 XT on RADV 26.2.6, RTX 3080 Ti on 620.70.6), the title and a new save's first area, no crash on any (the reports are linked in its comment below).Not tested: the crash window itself after a real crash, on any build.
Must be tested: None: the two builds this asked for are done (the Test Farm, above).
Risks
What could break: nothing I can name: the same function by its other name.
Turning it off: revert the commit.
Compatibility: Nothing changes.
Issues
None found for this (searched
strdup,oldnames,undefined symbol,lld-link). #983 added the calls; issue 439 is why the name is missing.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
@Beanstalk windows and linux: build this branch and start the game (the title screen, then a new save's first area for a few seconds). Expecting: it builds and links on both as main does, starts, and does not crash. The change is one name in
host/hos_crash_dialog.c(_strdupon Windows,strdupelsewhere), so there is nothing to measure: the build and the start are the test.🤖 Generated with Claude Code
Beanstalk test farm · an earlier run: commit
65945ab(the newer results are in a comment below)Commit
65945ab· tier reviewed · approved by GummiNaomi · dashboardWhat will be tested · default plan (AI failed: the model's response ended with error)
The AI plan failed: the model's response ended with error; using the default plan.
Done (started 08:15 UTC, last report 09:11 UTC). Comment
@Beanstalkto run it again.AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6; 2: linux+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 3080 Ti, 620.70.6Measurements · any
Verdict: pass on any (2/1 report): no rule failed and no PR run crashed.
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 3080 Ti, 620.70.6AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAMScene: title, from the title screen; hyrule-field, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); title: 2 game starts a side, title 20 s after 5 s warm-up; hyrule-field: 2 game starts a side, field 60 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)544229a65945abFlags and settings
None: the plan varied no setting, switch or build option.
Markdown for the PR description
WIP: fix(build): the crash window copies log lines by a name the MSVC target links (no "undefined symbol: strdup")to fix(build): the crash window copies log lines by a name the MSVC target links (no "undefined symbol: strdup")The crash window's two copies use
_strdupon Windows andstrdupeverywhere else. I read head65945ab. It applies onto current main. This is not a merge yet.The MSVC target links without
oldnames.lib, so the plain name is not there and the link stopped after the game had been compiled._strdupis the name that runtime provides, andfreeis still how those copies are released. The check reads the host sources and fails if a Windows build still calls one of those old names. Putting this file back names the twostrdupcalls.The Linux farm already built this head and started it: a title and Hyrule Field on a Radeon RX 7900 XT, no crash. The Windows llvm-mingw build named in Must be tested is still open. The farm's plan took one Linux machine and finished.
Thank you: built and started on two Linux PCs (RADV and NVIDIA), no crash. The farm took "any PC" and both were Linux, so one more for the other half:
@Beanstalk windows: build this branch and start the game (the title screen, then a new save's first area for a few seconds). Expecting: the Windows build links as main's does (
_strdupis the name this PR calls there), the game starts, and it does not crash.🤖 Generated with Claude Code
Beanstalk test farm
Commit
65945ab· tier reviewed · approved by GummiNaomi · dashboardWhat will be tested · AI plan (
gpt-6.1-terra)On Windows, the farm will build main and the pull request, then start the title screen and a new save's first area for a few seconds. The game runs take about 20–25 minutes per tester, apart from build time. A build or link failure, failure to reach either screen, or a crash fails the test; this smoke test does not exercise the crash dialog.
Done (started 09:28 UTC, last report 10:46 UTC). Run 2: re-planned by GummiNaomi. Comment
@Beanstalkto run it again.AMD Radeon RX 9070 XT, 2.0.416; 2: windows+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 4070, 621.1.0Measurements · windows
Verdict: pass on windows (2/1 report): no rule failed and no PR run crashed.
Hardware: 1: windows+amd+amd-proprietary+dgpu
AMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 4070, 621.1.013th Gen Intel(R) Core(TM) i7-13700F, 32 GB RAMScene: title, from the title screen; new-save, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); title: 1 game start a side; new-save: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
None: the plan varied no setting, switch or build option.
Markdown for the PR description