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

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

Open
mdiehl216 opened this issue May 28, 2024 · 8 comments
Open

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

mdiehl216 opened this issue May 28, 2024 · 8 comments

Comments

@mdiehl216
Copy link

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
Copy link

ReneSci commented May 29, 2024

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
Copy link
Member

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
Copy link

ReneSci commented May 30, 2024

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
Copy link
Member

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

@ReneSci
Copy link

ReneSci commented May 30, 2024

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
Copy link

ReneSci commented May 31, 2024

Latest nightly build - still leaves remainings:
image

@gunterkoenigsmann
Copy link
Member

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:

  • wxMaxima wants to close and starts to deinitialize.
  • When the queue handling is being unitialized all remaining signals in the event queues are flushed.
  • The child process exits shortly before wxMaxima does, which causes the wxProcess object that is associated with that process to queue an "child has exited" signal in the event queue.
  • But the memory said event queue is in already is freed.

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
Copy link

ReneSci commented Jun 4, 2024

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

  • opens another gnuplot process:
    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"

  • this starts a new process:

image

  • closed that pop out windows again - this also closes the process

  • then closed wxMaxima -which leaves this gnuplot process open process ID 22504:
    image
    Which was the one which was started up initially before plotting anything.

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 :-)

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