Repository navigation
Let an embedded run pass assert:debug instead of hanging in the console debugger - #718
Merged
Merged
Conversation
lagergren
added a commit
that referenced
this pull request
Oct 23, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 23, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
cpurdy
approved these changes
Oct 23, 2026
ggleyzer
reviewed
Oct 23, 2026
ggleyzer
left a comment
Collaborator
There was a problem hiding this comment.
Please give me couple of hours to think about it. I think it could be much simpler a solution
ggleyzer
requested changes
Oct 23, 2026
lagergren
added a commit
that referenced
this pull request
Oct 23, 2026
EvalCompiler, which compiles the console debugger's E in the frame where the program stopped, had three problems: - A variable held as a Ref, such as `@Inject Random random`, was captured with the Ref's type, so no method of the variable compiled: `E random.int(1)` failed with "Could not find a matching method or function "int" for type "@Inject Ref<Random>"". It is captured as its referent, which is what Frame.getArgument() reads. - A frame's variable was found only once its info had been made, and a parameter's info is made when it is first asked for. It now asks the frame, with Frame.getVarInfo(). - A lambda that did not compile stayed in the class it was added to, one more for every E that failed. It is removed. Tests: the new EmbeddingSupportTest case codeCompiledWhereARunStoppedSeesItsParametersAndInjectedValuesAndLeavesNoFailure runs a module that stops at assert:debug, with a debugger of its own set on the run's connector (#718), which compiles code there with EvalCompiler as the console debugger's E wraps it, before anything has asked for the frame's variables: `n + 1` for a parameter, `random.int(1)` for an injected value, and `nope`, after which the class must have as many lambdas as before. The connector gets Debugger.NONE back when the run ends. Validation: the case passes; with master's EvalCompiler it fails all three ways: "Name "n" is unresolvable.", "Could not find a matching method or function "int" for type "@Inject Ref<Random>"." and 3 lambdas instead of 2. :javatools:test passes 458 tests, the 42 existing skips; spotlessCheck passes. The three fixes are those of lagergren/errs d77fb9b, where the runtime debugger's evaluation shares EvalCompiler. Problems found and fixed: - Found on lagergren/errs, where the runtime debugger runs code in a stopped frame: `n` in a method's frame did not compile, nor did a call on an injected Console. Depends on #718, which gives a run its runtime's debugger, so that the test can set its own. Limits: on the console the parameter fix does not show, since it shows a frame's variables, and so makes their info, before E runs. E of a call without a value, such as `E console.print("hi")`, still fails: the console compiles E as a lambda that returns a value.
lagergren
added a commit
that referenced
this pull request
Oct 23, 2026
The EvalCompiler fixes' test needs #718's runtime debugger, so #721 is closed rather than stacked on #718. docs/remaining.md says why, and has an open item to file the fixes again once #718 is merged: the branch, its base, how to rebase it, what its test does, and why manualTests cannot drive the console instead. Validation: records only. Limits: nothing in master changes until #718 lands.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
docs/remaining.md: #723 is merged as 80bf83f. #722 is closed after review, since the interpreter keeps natural Ecstasy code and speed is the JIT's; its item is declined. #717 no longer carries the UID change, as decided on #677, which stays on this branch only. #719 replaces #718: both fix the hang, neither test catches it, and #719 has no debugger a host supplies, which now comes with the DAP work, and with it the refiling of the EvalCompiler fixes. #720's and #724's review changes are recorded, #720's with this branch's copy, 7fe6450. Validation: records only. The hang was reproduced with a program that runs a module with assert:debug through EmbeddingSupport and a standard input that stays open: master waits at "Enter command:", #718 and #719 end. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
The EvalCompiler fixes' test needs #718's runtime debugger, so #721 is closed rather than stacked on #718. docs/remaining.md says why, and has an open item to file the fixes again once #718 is merged: the branch, its base, how to rebase it, what its test does, and why manualTests cannot drive the console instead. Validation: records only. Limits: nothing in master changes until #718 lands.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
docs/remaining.md: #723 is merged as 80bf83f. #722 is closed after review, since the interpreter keeps natural Ecstasy code and speed is the JIT's; its item is declined. #717 no longer carries the UID change, as decided on #677, which stays on this branch only. #719 replaces #718: both fix the hang, neither test catches it, and #719 has no debugger a host supplies, which now comes with the DAP work, and with it the refiling of the EvalCompiler fixes. #720's and #724's review changes are recorded, #720's with this branch's copy, 7fe6450. Validation: records only. The hang was reproduced with a program that runs a module with assert:debug through EmbeddingSupport and a standard input that stays open: master waits at "Enter command:", #718 and #719 end. Limits: none.
lagergren
force-pushed
the
lagergren/fix-embedded-assert-debug
branch
from
October 26, 2026 18:18
a36cf63 to
e2f803c
Compare
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
On 2026-10-26 Gene accepted #718's approach if it also turns the debugger off globally, as #719 does. #718 now has the system property org.xvm.runtime.debugger=off (6de1166, with RuntimeDebuggerTest), drops the comment he asked about, keeps the console debugger once it is chosen, as Cam asked, and keeps getRuntime(), with its reason in the review thread. It is rebased onto master and Gene's review is re-requested; #719 closes once #718 merges, and the EvalCompiler fixes wait for #718 instead of #719. Validation: records only; #718's own validation is in its commit. Limits: none.
ggleyzer
requested changes
Oct 26, 2026
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
As Gene suggested on #718: the system property org.xvm.runtime.debugger=off now makes Debugger.NONE the runtime's debugger when the runtime is made, in place of a flag that getDebugger() checked, and Runtime.isDebuggerAllowed(), which only the test used, is gone. A host that sets a debugger later, such as an IDE's debug session, gets the one it set. Without the property the constructor still leaves the console debugger unmade: making DebugConsole.INSTANCE reads the user's Java preferences (Preferences.userNodeForPackage) for its breakpoints and history, and on Linux the preferences file store also starts a sync timer thread and adds a shutdown hook. getDebugger() makes it the first time it is asked, as before, and keeps it. Debugger.NONE's activate() names its frame parameter frame. Validation: :javatools:test passes 459 tests, the 42 existing skips; RuntimeDebuggerTest checks that with the property off the debugger is Debugger.NONE until a host sets the console. spotlessCheck passes. Limits: manualTests were not run again; the runtime without the property chooses its debugger as before.
ggleyzer
approved these changes
Oct 26, 2026
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
The EvalCompiler fixes' test needs #718's runtime debugger, so #721 is closed rather than stacked on #718. docs/remaining.md says why, and has an open item to file the fixes again once #718 is merged: the branch, its base, how to rebase it, what its test does, and why manualTests cannot drive the console instead. Validation: records only. Limits: nothing in master changes until #718 lands.
lagergren
added a commit
that referenced
this pull request
Oct 27, 2026
- R8 is done: the Windows soak is not planned, by decision on 2026-10-27, so remaining.md, the execution plan and the integration plan tick it. - The EvalCompiler fixes are filed again as #735, now that #718 is on master; #721 points to it. - #693 has the six fixes since its last sync that are not debugger work, with their hashes there. - The 2026-10-26 and 2026-10-27 rebase backups and their bundle are deleted; the commit maps keep the old hashes. Validation: docs only; #735's and #693's figures are from the runs on those branches (javatools 460 with 42 skipped on #735's branch; the mirrored commits' test classes on #693). Limits: records only.
lagergren
added a commit
that referenced
this pull request
Oct 27, 2026
EvalCompiler, which compiles the console debugger's E in the frame where the program stopped, had three problems: - A variable held as a Ref, such as `@Inject Random random`, was captured with the Ref's type, so no method of the variable compiled: `E random.int(1)` failed with "Could not find a matching method or function "int" for type "@Inject Ref<Random>"". It is captured as its referent, which is what Frame.getArgument() reads. - A frame's variable was found only once its info had been made, and a parameter's info is made when it is first asked for. It now asks the frame, with Frame.getVarInfo(). - A lambda that did not compile stayed in the class it was added to, one more for every E that failed. It is removed. Tests: the new EmbeddingSupportTest case codeCompiledWhereARunStoppedSeesItsParametersAndInjectedValuesAndLeavesNoFailure runs a module that stops at assert:debug, with a debugger of its own set on the run's connector (#718), which compiles code there with EvalCompiler as the console debugger's E wraps it, before anything has asked for the frame's variables: `n + 1` for a parameter, `random.int(1)` for an injected value, and `nope`, after which the class must have as many lambdas as before. The connector gets Debugger.NONE back when the run ends. Validation: the case passes; with master's EvalCompiler it fails all three ways: "Name "n" is unresolvable.", "Could not find a matching method or function "int" for type "@Inject Ref<Random>"." and 3 lambdas instead of 2. :javatools:test passes 458 tests, the 42 existing skips; spotlessCheck passes. The three fixes are those of lagergren/errs d77fb9b, where the runtime debugger's evaluation shares EvalCompiler. Problems found and fixed: - Found on lagergren/errs, where the runtime debugger runs code in a stopped frame: `n` in a method's frame did not compile, nor did a call on an injected Console. Depends on #718, which gives a run its runtime's debugger, so that the test can set its own. Limits: on the console the parameter fix does not show, since it shows a frame's variables, and so makes their info, before E runs. E of a call without a value, such as `E console.print("hi")`, still fails: the console compiles E as a lambda that returns a value.
This was referenced Oct 28, 2026
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
…the next run The runtime's fix, an embedded run's Debugger.NONE instead of the terminal's console debugger, came to master in #718 (bcd8e30). Of this commit, which brought it here first, the language server's test remains: EmbeddedExecutionTest runs a module that prints, reaches assert:debug and prints again, followed by another run on the same worker. Validation: before the runtime's fix the run timed out after 60 s waiting for its exit; with it, the run prints "before" and "after", and the next run gets its exit code 42. Limits: a run without a debugger still passes assert:debug; the debug sessions that follow give a debugged run a debugger of its own.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
The EvalCompiler fixes' test needs #718's runtime debugger, so #721 is closed rather than stacked on #718. docs/remaining.md says why, and has an open item to file the fixes again once #718 is merged: the branch, its base, how to rebase it, what its test does, and why manualTests cannot drive the console instead. Validation: records only. Limits: nothing in master changes until #718 lands.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
docs/remaining.md: #723 is merged as 80bf83f. #722 is closed after review, since the interpreter keeps natural Ecstasy code and speed is the JIT's; its item is declined. #717 no longer carries the UID change, as decided on #677, which stays on this branch only. #719 replaces #718: both fix the hang, neither test catches it, and #719 has no debugger a host supplies, which now comes with the DAP work, and with it the refiling of the EvalCompiler fixes. #720's and #724's review changes are recorded, #720's with this branch's copy, 7fe6450. Validation: records only. The hang was reproduced with a program that runs a module with assert:debug through EmbeddingSupport and a standard input that stays open: master waits at "Enter command:", #718 and #719 end. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
On 2026-10-26 Gene accepted #718's approach if it also turns the debugger off globally, as #719 does. #718 now has the system property org.xvm.runtime.debugger=off (6de1166, with RuntimeDebuggerTest), drops the comment he asked about, keeps the console debugger once it is chosen, as Cam asked, and keeps getRuntime(), with its reason in the review thread. It is rebased onto master and Gene's review is re-requested; #719 closes once #718 merges, and the EvalCompiler fixes wait for #718 instead of #719. Validation: records only; #718's own validation is in its commit. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
remaining.md ticks the soak on macOS and Linux, parity between the editors, current docs and each runtime PR validated on its own, and adds the soak on Windows as open. The execution plan and the integration plan say the same. The R8 entries now cite the commits on the current history, as the 2026-10-26b rebase map gives them. Validation: - Linux: arm64, JDK 25, in a Podman container on the Mac, as a user other than root, with one test fork, at 6b8f5bb. javatools' 686 tests pass (42 skipped). With --init on a quiet host, lsp-server's 2401 tests pass but the 2 always skipped, with the soak at 50 rounds (56 s), in 34 minutes. EmbeddedExecutionTest alone passes, 46 tests in 50 s, and its console test alone passes 3 times out of 3. - Parity at 718ddd6: VS Code passes all 34 run and debug cases; IntelliJ passes 21 of its 32 and the other 11 are partial, each with its recorded limit (the test driver, or LSP4IJ 0.21.0's UP32-UP42). - #716, #717, #718, #724, #731 and #693 pass CI on their heads, rebased onto master ddaa3d0. - CI's lang checks run on ubuntu-latest only (commit.yml), which is why Windows stays open. Problems found, as recorded in remaining.md: - As root, the read-only tests failed; they skip there (e4a8e68). - With Gradle as the container's PID 1, which does not reap, a killed server's worker stayed a zombie and the worker-exit test timed out. It passes with --init. - Under a load average of 37-75 on the Mac's 10 cores, time limits failed: XdkOnTypeFormattingTest's 20 ms, and the runtime's 1 s limit on a lazy toString() in the console test, whose program then stayed stopped on the class's shared worker, so three later tests failed. Limits: docs only. Windows is not validated. Dated records elsewhere keep the hashes they were written with.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
errs-integration-plan.md records the rebase of errs, #693, #716, #717 and #724 onto master bcd8e30, and errs-rebase-2026-10-27.tsv maps errs' 1037 old commits to their 1035 replays: two absorbed by #718, and one that keeps only its lsp-server test. Validation: every replayed commit has its old subject; the rebased tree differs from the old tip only in the files #731 and #718 change. :javatools:test 688 (42 skipped) and :lang:lsp-server:test 2401 (2 skipped) pass on the rebased errs. Limits: records only.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
- R8 is done: the Windows soak is not planned, by decision on 2026-10-27, so remaining.md, the execution plan and the integration plan tick it. - The EvalCompiler fixes are filed again as #735, now that #718 is on master; #721 points to it. - #693 has the six fixes since its last sync that are not debugger work, with their hashes there. - The 2026-10-26 and 2026-10-27 rebase backups and their bundle are deleted; the commit maps keep the old hashes. Validation: docs only; #735's and #693's figures are from the runs on those branches (javatools 460 with 42 skipped on #735's branch; the mirrored commits' test classes on #693). Limits: records only.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
…the next run The runtime's fix, an embedded run's Debugger.NONE instead of the terminal's console debugger, came to master in #718 (bcd8e30). Of this commit, which brought it here first, the language server's test remains: EmbeddedExecutionTest runs a module that prints, reaches assert:debug and prints again, followed by another run on the same worker. Validation: before the runtime's fix the run timed out after 60 s waiting for its exit; with it, the run prints "before" and "after", and the next run gets its exit code 42. Limits: a run without a debugger still passes assert:debug; the debug sessions that follow give a debugged run a debugger of its own.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
The EvalCompiler fixes' test needs #718's runtime debugger, so #721 is closed rather than stacked on #718. docs/remaining.md says why, and has an open item to file the fixes again once #718 is merged: the branch, its base, how to rebase it, what its test does, and why manualTests cannot drive the console instead. Validation: records only. Limits: nothing in master changes until #718 lands.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
docs/remaining.md: #723 is merged as 80bf83f. #722 is closed after review, since the interpreter keeps natural Ecstasy code and speed is the JIT's; its item is declined. #717 no longer carries the UID change, as decided on #677, which stays on this branch only. #719 replaces #718: both fix the hang, neither test catches it, and #719 has no debugger a host supplies, which now comes with the DAP work, and with it the refiling of the EvalCompiler fixes. #720's and #724's review changes are recorded, #720's with this branch's copy, 7fe6450. Validation: records only. The hang was reproduced with a program that runs a module with assert:debug through EmbeddingSupport and a standard input that stays open: master waits at "Enter command:", #718 and #719 end. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
On 2026-10-26 Gene accepted #718's approach if it also turns the debugger off globally, as #719 does. #718 now has the system property org.xvm.runtime.debugger=off (6de1166, with RuntimeDebuggerTest), drops the comment he asked about, keeps the console debugger once it is chosen, as Cam asked, and keeps getRuntime(), with its reason in the review thread. It is rebased onto master and Gene's review is re-requested; #719 closes once #718 merges, and the EvalCompiler fixes wait for #718 instead of #719. Validation: records only; #718's own validation is in its commit. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
remaining.md ticks the soak on macOS and Linux, parity between the editors, current docs and each runtime PR validated on its own, and adds the soak on Windows as open. The execution plan and the integration plan say the same. The R8 entries now cite the commits on the current history, as the 2026-10-26b rebase map gives them. Validation: - Linux: arm64, JDK 25, in a Podman container on the Mac, as a user other than root, with one test fork, at 6b8f5bb. javatools' 686 tests pass (42 skipped). With --init on a quiet host, lsp-server's 2401 tests pass but the 2 always skipped, with the soak at 50 rounds (56 s), in 34 minutes. EmbeddedExecutionTest alone passes, 46 tests in 50 s, and its console test alone passes 3 times out of 3. - Parity at 718ddd6: VS Code passes all 34 run and debug cases; IntelliJ passes 21 of its 32 and the other 11 are partial, each with its recorded limit (the test driver, or LSP4IJ 0.21.0's UP32-UP42). - #716, #717, #718, #724, #731 and #693 pass CI on their heads, rebased onto master ddaa3d0. - CI's lang checks run on ubuntu-latest only (commit.yml), which is why Windows stays open. Problems found, as recorded in remaining.md: - As root, the read-only tests failed; they skip there (e4a8e68). - With Gradle as the container's PID 1, which does not reap, a killed server's worker stayed a zombie and the worker-exit test timed out. It passes with --init. - Under a load average of 37-75 on the Mac's 10 cores, time limits failed: XdkOnTypeFormattingTest's 20 ms, and the runtime's 1 s limit on a lazy toString() in the console test, whose program then stayed stopped on the class's shared worker, so three later tests failed. Limits: docs only. Windows is not validated. Dated records elsewhere keep the hashes they were written with.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
errs-integration-plan.md records the rebase of errs, #693, #716, #717 and #724 onto master bcd8e30, and errs-rebase-2026-10-27.tsv maps errs' 1037 old commits to their 1035 replays: two absorbed by #718, and one that keeps only its lsp-server test. Validation: every replayed commit has its old subject; the rebased tree differs from the old tip only in the files #731 and #718 change. :javatools:test 688 (42 skipped) and :lang:lsp-server:test 2401 (2 skipped) pass on the rebased errs. Limits: records only.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
- R8 is done: the Windows soak is not planned, by decision on 2026-10-27, so remaining.md, the execution plan and the integration plan tick it. - The EvalCompiler fixes are filed again as #735, now that #718 is on master; #721 points to it. - #693 has the six fixes since its last sync that are not debugger work, with their hashes there. - The 2026-10-26 and 2026-10-27 rebase backups and their bundle are deleted; the commit maps keep the old hashes. Validation: docs only; #735's and #693's figures are from the runs on those branches (javatools 460 with 42 skipped on #735's branch; the mirrored commits' test classes on #693). Limits: records only.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
…the next run The runtime's fix, an embedded run's Debugger.NONE instead of the terminal's console debugger, came to master in #718 (bcd8e30). Of this commit, which brought it here first, the language server's test remains: EmbeddedExecutionTest runs a module that prints, reaches assert:debug and prints again, followed by another run on the same worker. Validation: before the runtime's fix the run timed out after 60 s waiting for its exit; with it, the run prints "before" and "after", and the next run gets its exit code 42. Limits: a run without a debugger still passes assert:debug; the debug sessions that follow give a debugged run a debugger of its own.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
The javatools part of 6312fd2 went to master as #718, from lagergren/fix-embedded-assert-debug off master 7a79c6e, as 8fb41cb, with its EmbeddingSupportTest case and without the EmbeddedExecutionTest case, which master has no file for. Validation: on that branch, after xdk:installDist, :javatools:test passes 457 tests, the 42 existing skips, and spotlessCheck passes. Limits: records only; no code changes here.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
R7q (550a4c0) adds four SessionDebuggerTest cases and the reason an evaluation abandoned by a resume fails with; it is burst K, javatools only. The tests item in docs/remaining.md keeps only source revisions, which waits for breakpoints tied to them. The #693 sync line names #718's two getRuntime() review changes, mirrored there as d7701ed and 5a68503. Validation: records only; the commit's own validation is in its message. Limits: no code changes here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A program run through
EmbeddingSupportthat reachesassert:debughangs. It stops in the console debugger, which waits for commands onSystem.in. A host whose standard input isn't a terminal, such as one that uses it as its own protocol pipe, never sees the program end, and the debugger can take the host's input as its commands.Root cause
ServiceContext.getDebugger()always returns the JVM-wideDebugConsole, whoever runs the program.Change
Runtime.getDebugger()returns the one the host set, or theDebugConsole, soxeckeeps its console debugger.InterpreterConnector.setDebugger()sets it.InterpreterControl.createConnector(), which everyEmbeddingSupportrun goes through, sets the newDebugger.NONE. With it,assert:debugcontinues with the next op, and since that debugger never becomes active, no breakpoint is checked.org.xvm.runtime.debugger=offmakesDebugger.NONEa runtime's debugger when the runtime is made, for exampleJAVA_OPTS=-Dorg.xvm.runtime.debugger=off xec TestSimple; a host that sets a debugger later gets the one it set.Runtime.getDebugger()makes theDebugConsolethe first time it is asked, and keeps it. Making it reads the user's Java preferences (and on Linux starts their sync timer and a shutdown hook), so a runtime that never debugs doesn't make it.Validation
EmbeddingSupportTest.assertDebugContinuesSinceAnEmbeddedRunHasNoDebugger: a module that prints, reachesassert:debugand prints again runs to its end throughrunMethod. In the Gradle test JVM the console debugger finds standard input at its end and continues too, so the test checks that the program goes on pastassert:debug; it doesn't reproduce the hang.RuntimeDebuggerTest: a runtime's debugger is theDebugConsoleuntil a host setsDebugger.NONE, and with the propertyoffit isDebugger.NONEuntil a host sets the console.xdk:installDist::javatools:testpasses 459 tests, 0 failures, the 42 existing skips;spotlessCheckpasses.Limits