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

It seems that a process of gnuplot_qt still runs after the program exits #68

Open
astrojhgu opened this issue Nov 19, 2020 · 3 comments

Comments

@astrojhgu
Copy link

I wrote a program that uses gnuplot to plot data. After the program terminates normally there will remain a running gnuplot_qt process.

The code of the minimum test program is

use gnuplot::{Figure};

fn main() {
    let mut fig=Figure::new();
    fig.axes2d().lines(&[1,2,3,4],&[1,2,3,4],&[]);
    fig.show().unwrap();
}

Before running the program, I run following commands to ensure that all previously running gnuplot have already been killed:

for i in `pgrep gnuplot`
do
    kill -9 $i
done
pgrep gnuplot

Then I run the program as

cargo run 

Then the gnuplot window appears and I close it manually.
Then the program exits normally.

I check the process by using

pgrep gnuplot

It shows that there is a running gnuplot_qt process.

I repeatly run my program and more gnuplot_qt will appear and keep running if I leave them alone.

The version of gnuplot crate I use is 0.0.37 and the gnuplot version in my system is gnuplot 5.2 patchlevel 8

@SiegeLord
Copy link
Owner

Hmm, I can reproduce this. I tried this in pure gnuplot, and it happened there too for the qt terminal, but not for x11 and wxt. I.e. running this script:

set terminal qt
plot x**2
pause mouse close
quit

gnuplot -p test.gnuplot

Also leaves a dangling gnuplot_qt process. It could be a gnuplot bug, or I (once again) don't understand how the -p option is meant to work.

@astrojhgu
Copy link
Author

Thanks for the reply.

I confirmed that this happens for qt while x11 works well.

So I work around by switching the terminal to x11 each time in my rust program.

Hmm, I can reproduce this. I tried this in pure gnuplot, and it happened there too for the qt terminal, but not for x11 and wxt. I.e. running this script:

set terminal qt
plot x**2
pause mouse close
quit

gnuplot -p test.gnuplot

Also leaves a dangling gnuplot_qt process. It could be a gnuplot bug, or I (once again) don't understand how the -p option is meant to work.

@daniilsunyaev
Copy link

daniilsunyaev commented Dec 25, 2021

Ran into the same problem today, same gnuplot version (5.2.8). Indeed, this should be a gnuplot bug:

  • 5.4.2 release log mentions "FIX qt: prevent creation of zombie gnuplot_qt process Bug #2188", corresponding ticket;
  • to be sure, I built from source, and checkinstalled newer version of gnuplot - looks like there are no gnuplot zombie processes generated in my system now, at least for my code.

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