Version: 5.4.1 (mingw windows build: gp541-win64-mingw.7z)
OS: Windows 10 20H2 (64 bit)
The plot window freezes if stdin is not a console.
set GNUTERM=windowstype con | gnuplotplot sin(x)If stdin is console (not a pipe), the problem does not occur. This also occurs with current git head (ceba2fa7054d001b4ababacf9cef23f9d89f4a9a), while version 5.2.8 works fine without the problem.
I found this issue occurs after the commit:
Reverting this commit solves the issue.
I wonder if it is the correct manner waiting for pipe handle using MsgWaitForMultipleObjects().
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-msgwaitformultipleobjects says MsgWaitForMultipleObjects() cannot be used with pipe handle.
It does not say it cannot be used with pipes, but does not list them explicitly in the list of allowed types ;). It works fine with piped input, like
cat simple.dem | gnuplotoryes | gnuplot simple.dem. Also in your case the pipe itself works fine. But processing the message queue commands seems not to work. In your case, these do no longer trigger MsgWaitForMultipleObjects(). Interestingly,echo plot x; pause mouse; quit | gnuplotworks as expected. This uses nearly the same code in win_sleep().The same issue happens with:
(cat simple.dem; sleep 100) | gnuplot(echo plot x; sleep 100) | gnuplotIf the handle passed to MsgWaitForMultipleObjects() is a pipe, it can response to pipe input, however, it does not response to window event. Timeout also does not work.
No. I was wrong. MsgWaitForMultipleObjects() always returns WAIT_OBJECT_0 even if the pipe input is not ready when a pipe handle is passed.
Due to this issue, gnuplot cannot be used as graphics toolkit for GNU octave any more.
I have the same or a similar problem.
I'm using gnuplot in combination with ruby (using the gem gnuplot-2.6.2).
Everything works fine with gnuplot 5.2.8, but when I install gnuplot 5.4.1 ruby "hangs" and no plot window opens (or no file is generated).
In Windows Task Manager I can see that an instance of gnuplot is created.
Unfortunately for me this means that I had to go back to gnuplot 5.2.8 until this is resolved.
I think I finally have pushed a reasonable solution to the 5.5 master branch: We keep the thread for pipe input and signal to the main event via an event object on new input. Please let me know if that fixes it.
I have confirmed that the issue has been fixed in the current git head.
Thanks for working on this.
Great. Thanks for the confirmation. Sorry that it took so long.