Repository navigation
Description
Problem
Sentry issue RAXMLGUI2-2DH (TypeError: Object has been destroyed, raxmlGUI 2.0.17, Windows) shows RAxML stdout (Bootstrap[1076]) arriving in the main process after window.closed, window-all-closed, before-quit and will-quit. So a run was still alive after the user closed the window. Nothing in src/main/index.ts stops tracked runs on close or quit, and src/main/cancelRun.ts only kills a process when the renderer asks for a cancel.
The crash itself (unguarded event.sender.send in send, src/main/processHelpers.ts:61) is a separate fix and is not part of this ticket.
Step 1: research
Find out whether the RAxML binary keeps running after the application has been closed. Start a long run (a bootstrap analysis), close the window, and check the process list.
- Windows, Linux: closing the last window calls
app.quit(). Does the child process outlive the app process? - macOS: closing the last window leaves the app running. Does the run continue with no window, and what happens to it on Cmd+Q?
- Cover every binary the app spawns through
spawnProcessandtrackRun: RAxML, RAxML-NG, ModelTest-NG, ASTRAL.
Post the findings per platform as a comment on this ticket. If no process survives on any platform and no run continues windowless, stop there and close the ticket with that comment.
Step 2: confirm on close (only if step 1 finds a surviving or windowless run)
When the user closes a window while one of its runs is in progress, show a dialog asking whether they really want to stop the run by closing the window.
- Cancel keeps the window open and the run untouched.
- Confirm goes to step 3.
- No dialog when no run is in progress.
- Quitting the app (Cmd+Q, menu Quit) with a run in progress asks the same question.
Step 3: abort the run
On confirm, stop every run that belongs to the closing window, using the existing cancelRun / stopRun path in src/main/cancelRun.ts, then let the window close. After the app quits, no spawned binary is left in the process list.
Acceptance criteria
- A comment on this ticket states, per platform tested, whether each binary survives window close and app quit, and how that was checked.
- Closing a window with a run in progress shows a confirmation dialog; Cancel leaves the window and run as they were.
- Confirming kills the run's process and closes the window.
- Closing a window with no run in progress shows no dialog.
- After app quit, no RAxML, RAxML-NG, ModelTest-NG or ASTRAL process started by the app remains.
- A test covers the close-with-running-run decision (dialog shown, cancel keeps the run, confirm stops it).
Not checked when filing
Process survival was inferred from the Sentry breadcrumbs only; it has not been reproduced. Only a Mac is available locally, so the Windows and Linux answers may need CI or a human.
Activity
jtklein-agents commentedon Nov 27, 2026
Step 1 findings: does a run outlive the window or the app?
Tested on macOS only (Apple Silicon, Electron from this repo). Windows and Linux were not tested: no machine was available.
How it was checked
A throwaway Electron main spawned each binary the way
spawnProcessdoes (child_process.execFile, no shell on macOS). Each binary ran a long job onstatic/example-files/fasta/dna.txt:raxmlHPC -f a -N 10000(rapid bootstrap plus ML search)raxml-ng --bootstrap --bs-trees 10000modeltest-ngThe script then called
app.quit()after 3 s, andps -o pid,ppid -p <pids>listed what was left. Two control children were added:/bin/sleep 60, which writes nothing, and a shell loop that prints a line every 5 s.macOS results
raxmlHPC)window-all-closeddoes not quit on darwin), so the run continues windowless.java -jar)execFilepath).execFilepath, so I expect the same behaviour, but that is unverified./bin/sleep(no output)So on macOS, after quit a binary survives for as long as it stays silent, and it keeps using CPU in that time. A long single ML search on a big alignment can stay silent for a long time.
Windows and Linux (not tested, inferred only)
window-all-closedcallsapp.quit()there, so closing the window equals quitting.will-quit) fit this. Also,spawnProcessusesshell: trueon Windows, so the tracked process iscmd.exe.proc.kill()(and thereforecancelRun) may kill onlycmd.exeand leave the binary running. That would affect the normal Cancel button too. This needs a check on a real Windows machine.Steps 2 and 3
Because runs survive on macOS (windowless, and silent ones after quit), steps 2 and 3 are implemented on branch
332-raxml-keeps-running-after-close. The real app was checked on macOS with Playwright and a stubbed dialog:modeltest-ngprocess.pgrep modeltest-ngfinds nothing.jtklein-agents commentedon Nov 27, 2026
Shipped in AntonelliLab#529 (merged as d740620). Still open: Windows (stopping a run may only kill cmd.exe because spawnProcess uses shell: true) and ASTRAL were not checked; see the findings comment above.
Confirm before closing a window with a run in progress (#332) (Antone…