wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
459 stars 96 forks source link

Request: On Windows, kill sbcl when quitting wxmaxima #1922

Open mdiehl216 opened 1 month ago

mdiehl216 commented 1 month ago

After quitting wxmaxima, the process sbcl is still running on Windows. Files that were opened with the process cannot be renamed or deleted. It would be nice if sbcl is quitted together with wxmaxima.

Also, does restarting maxima start another instance of sbcl? In this case the previous sbcl task could also be canceled. I often find multiple instances of sbcl running on Windows 10.

Thank you! Matthias

ReneSci commented 1 month ago

I see the same image

(%o1) build_info(version="branch_5_47_base_1182_gdc9d6aaaf",timestamp="2024-05-27 23:51:21",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.4.4",maxima_userdir="C:/Users/xx/maxima",maxima_tempdir="C:/Users/xxxx/AppData/Local/Temp",maxima_objdir="C:/Users/xxx/maxima/binary/branch_5_47_base_1182_gdc9d6aaaf/sbcl/2_4_4",maxima_frontend="wxMaxima",maxima_frontend_version="24.05.0_DevelopmentSnapshot_MSW")

gunterkoenigsmann commented 1 month ago

Actually maxima should automatically close when we close our connection to maxima. If it doesn't that should be a maxima bug. But I found one more way to kill maxima. Let's hope that that one helps.

...and a question to all MS windows testers: Does the maxima process just not stop hang around when maxima closes or does it use 100% of a CPU? Background: There once was a bug that caused maxima output a message on closing, which, if that closing message was caused by wxMaxima closing the connection caused an error message that, since the connection was still closed caused another error message which...

ReneSci commented 1 month ago

Hmmm... is seems like it just stays there. Including gnuplot... image

If I just opens an empty work sheet without using it - it also starts gnuplot: image

.... and leaves gnuplot running after closing wxMaxima: image

gunterkoenigsmann commented 1 month ago

For gnuplot currently no attempt is made for killing it. Should wxMaxima try to kill gnuplot on closing?

ReneSci commented 1 month ago

I would guess so. Normal users, which dosen't use software such as "Process Explorer", will never realize that gnuplot is left behind on their machine taking up memory etc.

ReneSci commented 1 month ago

Latest nightly build - still leaves remainings: image

gunterkoenigsmann commented 1 month ago

The wgnuplot processes are left open without any window that, if closed, would close them?

What I have changed a few months ago is that I told the wxProcess associated with every program wxMaxima starts to Detach() on closing wxMaxima - which resolved crashes in the test bench that occurred according to the following race condition:

Detach() tells a wxProcess to no more queue events. Now I wonder if that caused some side effects...

...process Management on Linux, Android and Mac Os seems to be so much easier than on MS Windows - which I currently have no access to: Too old a processor and too little RAM even for emulating a Windows PC.

ReneSci commented 4 weeks ago

The wgnuplot processes are left open without any window that, if closed, would close them? -> yes

Just installed the latest nightly build:

(%o1)   build_info(version="branch_5_47_base_1186_gf90a7d21b",timestamp="2024-06-03 23:51:50",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.4.5",maxima_userdir="C:/Users/xxx/maxima",maxima_tempdir="C:/Users/xxxx/AppData/Local/Temp",maxima_objdir="C:/Users/xxx/maxima/binary/branch_5_47_base_1186_gf90a7d21b/sbcl/2_4_5",maxima_frontend="wxMaxima",maxima_frontend_version="24.05.0_DevelopmentSnapshot_MSW")

Just starting wxMaxima with an empty worksheet seems to open a number of gnuplot processes without any visible windows: image

Using gnuplot with wxdraw2d(explicit(sin(x), x, 0, 10)) does not start more processes.

Using the "Pup out interactively" (which now works quite nicely with access to the gnuplot command window :-) ) image

Closing the pop out also closes the corresponding process closes nicly.

Using draw2d(explicit(sin(x), x, 0, 10)); Opens another type of pup out window with much less functionality: image

starts some other proceses: image

However - they dosen't close when closing that gnuplot pop out window: image

Closing wxMaxima after this session, leaves the above gnuplot process open (with no visible window): image

Notice, the process ID: 14808..


Tried to start wxMaxima with an empty worksheet - did a plot wxdraw2d(explicit(sin(x), x, 0, 10)); - used the "Pop out Interactively"

image

It seems like is the gnuplot process wich is initiated at wxMaxima start up, that is left behind when closing wxMaxima

Hopes this makes sense :-)