Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBCL.exe sometimes is not stopped when WxMaxima is closed. #1824

Open
richardgobeli opened this issue Oct 19, 2023 · 7 comments
Open

SBCL.exe sometimes is not stopped when WxMaxima is closed. #1824

richardgobeli opened this issue Oct 19, 2023 · 7 comments

Comments

@richardgobeli
Copy link
Collaborator

When I try to uninstall to load a new version, I notice that the installation stops because SBCL.exe is still running. This makes it so the uninstall does not complete.

Do you know why sometimes in Windows the app SBCL does not stop when WxMaxima is stopped?

I think this happens even when WxMaxima had a normal stop.

This has been happening the last month I think for the different versions with issues in the graphics.

@richardgobeli richardgobeli changed the title SBCL.exe sometimes is not deleted when WxMaxima is closed. SBCL.exe sometimes is not stopped when WxMaxima is closed. Oct 19, 2023
@gunterkoenigsmann
Copy link
Member

The problem is that I don't know any way in MS Windows for an application to forcefully kill all subprocesses it has created. I can ask Maxima kindly to exit. But sometimes that doesn't work...

@daute
Copy link
Member

daute commented Oct 21, 2023

taskkill (with the option /T (kill child processes, as maxima is a batch file)) or wxKill (maybe on Windows with wxSIGKILL as mentioned in the wxWidgets docu) should do this:
https://docs.wxwidgets.org/3.0/group__group__funcmacro__procctrl.html
https://ss64.com/nt/taskkill.html

But where is the maxima process killed? I do not find a call to wxKill() anywhere in the source

@gunterkoenigsmann
Copy link
Member

In wxMaxima::KillMaxima I use wxSigKill...

@gunterkoenigsmann
Copy link
Member

I've added a call to wxKill, but my suspicion is that the main problem might be that maxima is a child of cmd.exe, not of wxMaxima

@gunterkoenigsmann
Copy link
Member

In theory when killing Maxima we close its stdin and stdout, which should kill Maxima, anyway. But perhaps Maxima doesn't always listen to that event....

@richardgobeli
Copy link
Collaborator Author

Is it Maxima or not? I need to kill SBCL.exe.

@gunterkoenigsmann
Copy link
Member

The problem is that Maxima is officially started using maxima.bat that then starts clisp.exe, maxima.exe, gcl.exe or sbcl.exe. Maxima at startup tells us which process ID that program has, but MS Windows won't let wxMaxima to send a kill signal to that program.

Maxima should exit, anyway, when there no more is a process that owns its stdin or stdown stream, anyway. Bit seems that might fail, too. Wolfgang now has sent two commits that tell wxWidgets to try harder to kill Maxima, when it tries to

daute added a commit that referenced this issue Oct 13, 2024
Until now, the pid was not set (and -1
was printed during the logging). This
(hopefully) helps with issues, where
the "not killing" of Maxima processes
was reported, e.g. #1199, #1824, #1922
or #1963.
daute added a commit that referenced this issue Jan 12, 2025
That did only kill the direct child processes.
My solution (commit c957270)
should - hopefully - solve issues #1963, #1922 and #1824.
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

No branches or pull requests

3 participants