Repository navigation
Build: refuse a DLR checkout that lacks a patch (Backtrace9, #132) - #151
Conversation
Backtrace9 failed in some Linux environments with the backtrace starting at caller_of_many instead of many (issue 132). Those builds were against a DLR checkout patched before 0103-reflection-call-rethrow.patch landed: without it the interpreter rethrows what a method called through MethodInfo.Invoke raised with `throw inner`, which restarts the CLR stack trace and drops the raising method's frame. The output is exactly that: built against a DLR with 0103 reverted, Backtrace9 prints caller_of_many / Backtrace9.rb / CompilerTest. With every patch applied the frames are many, caller_of_many, the top level - the order CRuby 4.0 gives (Object#many, Object#caller_of_many, <main>) - on net8.0 and net10.0, isolated and in the full suite, with tiered compilation off, MinOpts, PGO off, a call-count threshold of 1, a warmed-up reflection invoker, and in a fresh dotnet/sdk:10.0-noble container. So the runtime is right and the test is not environment-dependent; the environment was a stale DLR. A DLR checkout is patched once and nothing noticed when it fell behind: only `make test` ran Util/check-dlr-patches.sh, and only to warn. Building IronRuby.dll now runs it (off Windows, where sh and git may be missing) and fails, naming the missing patch; -p:CheckDlrPatches=false skips it. The script also passes a DLR copied into another repository (make-dlr-copy.sh's), which is not a DLR checkout to check. Checked: the build fails against a DLR with 0103 reverted (also with a backslash DlrSourceDir), passes with -p:CheckDlrPatches=false and with all patches applied; full IronRuby.Tests suite passes. Fixes #132 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 48 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…deRabbit on #151) A DLR copied into a directory inside a DLR checkout found that checkout as its git top level and was checked against the outer checkout's files: the build could reject a patched copy because the outer checkout was stale (CodeRabbit's merge-risk note). A src/core given directly is now checked only when it is the top level's own src/core; any other copy passes, as a copy in another repository already did. Checked: the script exits 0 for a patched checkout (given as its root or src/core), 1 for a stale one (root, src/core or src/core/Microsoft.Dynamic), and 0 for a copy of src/core inside the stale checkout; IronRuby.dll builds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@coderabbitai Your merge-risk note (a patched DLR copied inside another DLR checkout could be rejected) is addressed in 3bcce51: a |
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
This addresses the reported merge risk. I did not run the script or build. You are interacting with an AI system. |
Fixes #132
Cause
Backtrace9fails exactly when IronRuby is built against a DLR checkout without0103-reflection-call-rethrow.patch. Without it the interpreter rethrows what a method called throughMethodInfo.Invokeraised (a Ruby method with ~10+ parameters) withthrow inner, which restarts the CLR stack trace and drops the raising method's frame. Built against a DLR with only 0103 reverted, the test printscaller_of_many / Backtrace9.rb / CompilerTest: the "extracaller_of_manyframe first" from the issue.The failing "fresh container" was a cloud session whose DLR had been patched before 0103 landed (2026-11-06);
ecc3390dalready has the test and the patch file, so a DLR patched from an earlier tree fails it, while CI applies every patch to a fresh checkout and passes. Nothing noticed: onlymake testranUtil/check-dlr-patches.sh, and only to warn.With every patch applied the runtime is right: frames
many,caller_of_many, top level, the order CRuby 4.0 gives (Object#many,Object#caller_of_many,<main>). It is not JIT- or order-dependent. Backtrace9 passed in all of these:DOTNET_TieredCompilation=0,TC_QuickJit=0,ReadyToRun=0,TieredPGO=0,JitMinOpts=1,TC_CallCountThreshold=1, and server GCmcr.microsoft.com/dotnet/sdk:10.0-noblecontainer (runtime 10.0.14), isolated and in the full suiteChange
IronRuby.dllrunsUtil/check-dlr-patches.shagainstDlrSourceDirand fails, naming the missing patch, when the DLR lacks one. It runs off Windows only, whereshandgitcan be counted on.-p:CheckDlrPatches=falseskips it. A DLR that is not a git checkout (a source tarball) passes, as before.check-dlr-patches.shalso passes a DLR copied into some other repository (make-dlr-copy.sh's), which is not a DLR checkout it can check.CLAUDE.mdandBuild/dlr-patches/README.md.Backtrace9's comment now says what it shows without the patch.The test is unchanged: its expectation is right.
Checked
DlrSourceDir), and passes with-p:CheckDlrPatches=falseand with all patches applied.libz.so.1but nolibz.so, whichZlibloads (Zlib_*,NetHttp_*,Puma_Tls1), anddotnetran as PID 1 without--init(Process_SpawnKill1: ECHILD).Not in this PR
IronRuby labels these frames
many/caller_of_manyand the top level withoutin, while CRuby 4.0 saysObject#many/<main>(the 3.4 label format). That is wider than this test.🤖 Generated with Claude Code
Summary by CodeRabbit
-p:CheckDlrPatches=false.