Discussion:
5.2 rc2 tarball now available
sfeam via gnuplot-beta
2017-07-04 02:18:04 UTC
Permalink
One month of -rc1 turned up one serious bug, a couple of minor bugs that
were easily triggered, and a bunch of odd corner cases found by fuzz-testing
that could only be hit by invalid command syntax or strange input data.
Not too bad.

So here is -rc2

Release Notes date: 03-Jul-2017

CHANGES SINCE rc1
=================
* FIX: terminal initialization must complete before executing ~/.gnuplot
* FIX: incorrect clipping of polar border and raxis
* FIX: add sanity checks to detect and handle various types of bad input data
or command syntax found by fuzz-testing
* FIX: windows terminal (various minor tweaks)


Ethan
Tatsuro MATSUOKA
2017-07-04 03:43:32 UTC
Permalink
----- Original Message -----
From: sfeam via gnuplot-beta
Date: 2017/7/4, Tue 11:18
Subject: 5.2 rc2 tarball now available
One month of -rc1 turned up one serious bug, a couple of minor bugs that
were easily triggered, and a bunch of odd corner cases found by fuzz-testing
that could only be hit by invalid command syntax or strange input data.
Not too bad.
So here is -rc2
Release Notes date: 03-Jul-2017
CHANGES SINCE rc1
=================
* FIX: terminal initialization must complete before executing ~/.gnuplot
* FIX: incorrect clipping of polar border and raxis
* FIX: add sanity checks to detect and handle various types of bad input data
      or command syntax found by fuzz-testing
* FIX: windows terminal (various minor tweaks)
    Ethan
I have built windows binary packages for -rc2 and uploeded SourceForge site.

Tatsuro
Petr Mikulik
2017-07-04 15:26:11 UTC
Permalink
Hello,

I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.

It is this problem:
https://sourceforge.net/p/gnuplot/support-requests/196/

The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.

Can this be fixed?

***

Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too narrow),
while x11 and wxt pass well.

***

Those two dummy terminals show 90123456789 instead of 0123...90123...9 in the
character width test:
set term dumb; test
set term caca; test

***

Is caca still experimental?
It's just fun, but it's nice, mouseable and it seems to work, so I propose to
have it not experimental.

***

Greetings,
Petr
sfeam via gnuplot-beta
2017-07-04 15:59:56 UTC
Permalink
Post by Petr Mikulik
Hello,
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Post by Petr Mikulik
***
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too narrow),
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
Post by Petr Mikulik
***
Those two dummy terminals show 90123456789 instead of 0123...90123...9 in the
set term dumb; test
set term caca; test
The horizontal arrow is being drawn on top of test string 01234567890123456789
Probably the arrows should be smaller, or drawn in back of the text
Post by Petr Mikulik
***
Is caca still experimental?
It's just fun, but it's nice, mouseable and it seems to work, so I propose to
have it not experimental.
Good point.
Also I have just noticed that the caca terminal documentation
is not always included in user manual.
Post by Petr Mikulik
***
Greetings,
Petr
sfeam via gnuplot-beta
2017-07-04 17:46:09 UTC
Permalink
On Tue, Jul 4, 2017 at 10:59 AM, sfeam via gnuplot-beta <
Post by Petr Mikulik
Post by Petr Mikulik
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too
narrow),
Post by Petr Mikulik
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
​I can reproduce it and it is definitely font/font size dependent but ​
​mostly wrong than right​.
Attached are screenshots with fonts set to "DroidSans,9" (bad)
and "DroidSans,14" (OK).
Huh. It works fine for me. Mageia 5/Qt5

screenshot attached from
set term qt font "DroidSans,9"; test

I am still guessing it is an error in font handling, external to gnuplot.

Ethan
This is on Fedora 26/Qt5
Dmitri.
--
Dmitri A. Sergatskov
2017-07-04 17:58:08 UTC
Permalink
Post by sfeam via gnuplot-beta
On Tue, Jul 4, 2017 at 10:59 AM, sfeam via gnuplot-beta <
Post by Petr Mikulik
Post by Petr Mikulik
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too
narrow),
Post by Petr Mikulik
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
​I can reproduce it and it is definitely font/font size dependent but ​
​mostly wrong than right​.
Attached are screenshots with fonts set to "DroidSans,9" (bad)
and "DroidSans,14" (OK).
Huh. It works fine for me. Mageia 5/Qt5
screenshot attached from
set term qt font "DroidSans,9"; test
I am still guessing it is an error in font handling, external to gnuplot.
Ethan
This is on Fedora 26/Qt5
Dmitri.
--
​Perhaps. The kerning looks different (see e.g. the spacing between "t" and
"e" in "test")

I will try on plasma desktop.

Dmitri​.
--
sfeam via gnuplot-beta
2017-07-04 18:12:48 UTC
Permalink
Post by sfeam via gnuplot-beta
On Tue, Jul 4, 2017 at 10:59 AM, sfeam via gnuplot-beta <
Post by Petr Mikulik
Post by Petr Mikulik
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too
narrow),
Post by Petr Mikulik
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
​I can reproduce it and it is definitely font/font size dependent but ​
​mostly wrong than right​.
Attached are screenshots with fonts set to "DroidSans,9" (bad)
and "DroidSans,14" (OK).
Huh. It works fine for me. Mageia 5/Qt5
screenshot attached from
set term qt font "DroidSans,9"; test
I am still guessing it is an error in font handling, external to gnuplot.
Ethan
This is on Fedora 26/Qt5
Dmitri.
--
​Perhaps. The kerning looks different (see e.g. the spacing between "t" and
"e" in "test")
I will try on plasma desktop.
I have the Droid fonts courtesy of TexLive. They provide them as *.ttf and as
*.afm + *.pfb

I specifically tested the ttf variant. Can you check if you are using an Adobe
variant instead? Or for that matter a TeX-processed *.vf or *.tfm version?
The pre-processed versions in particular would be likely to scale badly.

Ethan
Dmitri A. Sergatskov
2017-07-04 18:33:50 UTC
Permalink
Post by Dmitri A. Sergatskov
Post by sfeam via gnuplot-beta
On Tue, Jul 4, 2017 at 10:59 AM, sfeam via gnuplot-beta <
Post by Petr Mikulik
Post by Petr Mikulik
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is
too
Post by Dmitri A. Sergatskov
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
narrow),
Post by Petr Mikulik
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
​I can reproduce it and it is definitely font/font size dependent
but ​
Post by Dmitri A. Sergatskov
Post by sfeam via gnuplot-beta
​mostly wrong than right​.
Attached are screenshots with fonts set to "DroidSans,9" (bad)
and "DroidSans,14" (OK).
Huh. It works fine for me. Mageia 5/Qt5
screenshot attached from
set term qt font "DroidSans,9"; test
I am still guessing it is an error in font handling, external to
gnuplot.
Post by Dmitri A. Sergatskov
Post by sfeam via gnuplot-beta
Ethan
This is on Fedora 26/Qt5
Dmitri.
--
​Perhaps. The kerning looks different (see e.g. the spacing between "t"
and
Post by Dmitri A. Sergatskov
"e" in "test")
I will try on plasma desktop.
I have the Droid fonts courtesy of TexLive. They provide them as *.ttf and as
*.afm + *.pfb
I specifically tested the ttf variant. Can you check if you are using an Adobe
variant instead? Or for that matter a TeX-processed *.vf or *.tfm version?
The pre-processed versions in particular would be likely to scale badly.
​I used Google's Droid fonts.
I have tried many fonts, and all of them have this problem. if you play
with the size, you can find a range where it is almost OK, but usually it
is not.
Here is with dejavu sans mono 9 (this is actually the best fit I could get
--
it gets worse for either smaller or bigger sizes).
​(This is still on Gnome desktop).​
Ethan
sfeam via gnuplot-beta
2017-07-04 19:05:33 UTC
Permalink
Post by sfeam via gnuplot-beta
Post by sfeam via gnuplot-beta
On Tue, Jul 4, 2017 at 10:59 AM, sfeam via gnuplot-beta <
Post by Petr Mikulik
Post by Petr Mikulik
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is
too
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
narrow),
Post by Petr Mikulik
while x11 and wxt pass well.
I don't see this problem here.
Is it maybe an issue with the font?
​I can reproduce it and it is definitely font/font size dependent
but ​
Post by sfeam via gnuplot-beta
​mostly wrong than right​.
Attached are screenshots with fonts set to "DroidSans,9" (bad)
and "DroidSans,14" (OK).
Huh. It works fine for me. Mageia 5/Qt5
screenshot attached from
set term qt font "DroidSans,9"; test
I am still guessing it is an error in font handling, external to
gnuplot.
Post by sfeam via gnuplot-beta
Ethan
This is on Fedora 26/Qt5
Dmitri.
--
​Perhaps. The kerning looks different (see e.g. the spacing between "t"
and
"e" in "test")
I will try on plasma desktop.
I have the Droid fonts courtesy of TexLive. They provide them as *.ttf and as
*.afm + *.pfb
I specifically tested the ttf variant. Can you check if you are using an Adobe
variant instead? Or for that matter a TeX-processed *.vf or *.tfm version?
The pre-processed versions in particular would be likely to scale badly.
​I used Google's Droid fonts.
I have tried many fonts, and all of them have this problem. if you play
with the size, you can find a range where it is almost OK, but usually it
is not.
Here is with dejavu sans mono 9 (this is actually the best fit I could get
--
it gets worse for either smaller or bigger sizes).
​(This is still on Gnome desktop).​
I believe you, but I have never seen this problem here with any "normal" font.
That is, I see it for weird stuff like
set term qt font "Bernard MT Condensed"
or
set term qt font "Felix Titling"
but those are the only 2 that were imperfect out of dozens that I just tested.

More to the point... Is it only the "test" command that has a problem?
If so I don't think we really care that much. If boxed text in general is
failing that would be a bigger issue.


Ethan
Dmitri A. Sergatskov
2017-07-04 19:29:53 UTC
Permalink
Post by sfeam via gnuplot-beta
More to the point... Is it only the "test" command that has a problem?
If so I don't think we really care that much. If boxed text in general is
failing that would be a bigger issue.
​Here is the output of a script;

​set label "1234567890" at 0,-0.4 boxed font "DejaVuSans, 5"
set label "1234567890" at 0,-0.2 boxed font "DejaVuSans, 7"
set label "1234567890" at 0,0 boxed font "DejaVuSans, 9"
set label "1234567890" at 0,0.2 boxed font "DejaVuSans, 12"
set label "1234567890" at 0,0.4 boxed font "DejaVuSans, 14"
set label "1234567890" at 0,0.6 boxed font "DejaVuSans, 18"
set label "1234567890" at 0,0.8 boxed font "DejaVuSans, 24"
plot sin(x)

One can see that the problem is still there at very small (and perhaps very
large) font sizes.
​The problem seems to be qt related. It looks fine reploted to e.g.
pngcairo.
Post by sfeam via gnuplot-beta
Ethan
​Dmitri.
--
​
Daniel J Sebald
2017-07-04 22:47:56 UTC
Permalink
Post by sfeam via gnuplot-beta
More to the point... Is it only the "test" command that has a problem?
If so I don't think we really care that much. If boxed text in general is
failing that would be a bigger issue.
​Here is the output of a script;
​set label "1234567890" at 0,-0.4 boxed font "DejaVuSans, 5"
set label "1234567890" at 0,-0.2 boxed font "DejaVuSans, 7"
set label "1234567890" at 0,0 boxed font "DejaVuSans, 9"
set label "1234567890" at 0,0.2 boxed font "DejaVuSans, 12"
set label "1234567890" at 0,0.4 boxed font "DejaVuSans, 14"
set label "1234567890" at 0,0.6 boxed font "DejaVuSans, 18"
set label "1234567890" at 0,0.8 boxed font "DejaVuSans, 24"
plot sin(x)
One can see that the problem is still there at very small (and perhaps
very large) font sizes.
​The problem seems to be qt related. It looks fine reploted to e.g.
pngcairo.
With a rudimentary browsing of the code, it doesn't seem to me that we
should expect the boxed text to be too accurate. As for the test image,
it's

/* test width and height of characters */
(*t->linetype) (LT_SOLID);
newpath();
(*t->move) (x0 + xmax_t / 2 - t->h_char * 10, y0 + ymax_t / 2 +
t->v_char / 2);
(*t->vector) (x0 + xmax_t / 2 + t->h_char * 10, y0 + ymax_t / 2 +
t->v_char / 2);
(*t->vector) (x0 + xmax_t / 2 + t->h_char * 10, y0 + ymax_t / 2 -
t->v_char / 2);
(*t->vector) (x0 + xmax_t / 2 - t->h_char * 10, y0 + ymax_t / 2 -
t->v_char / 2);
(*t->vector) (x0 + xmax_t / 2 - t->h_char * 10, y0 + ymax_t / 2 +
t->v_char / 2);
closepath();

which is only a rough estimate at the font-processed string width in
pixels, assuming a constant-width character. The test image code should
be placing a box similar to the way in with text/label items are placing
a box.

But even in the case of labels with the "boxed" qualifier, I don't see
any mechanism for either feeding the string width from the terminal back
to gnuplot so that it can draw a box, or specifying to the terminal that
it should put a box around the text it is requesting. That is, the
proper Qt mechanism is to use a QFontMetrics, in particular its
boundingRect() function which accepts a string as an input. E.g.,

https://stackoverflow.com/questions/8633433/qt-get-the-pixel-length-of-a-string-in-a-qlabel

gnuplot Qt terminal does appear to attempt such a thing by:


#ifdef EAM_BOXED_TEXT
exit(25);
if (m_inTextBox) {
m_currentTextBox |= rect;
m_currentBoxRotation = m_textAngle;
m_currentBoxOrigin = point;
}
#endif

[snip]

case TEXTBOX_OUTLINE:
/* Stroke bounding box */
outline = m_currentTextBox.adjusted(
-m_textMargin.x(), -m_textMargin.y(),
m_textMargin.x(), m_textMargin.y());
exit(26);
rectItem = addRect(outline, m_currentPen, Qt::NoBrush);
rectItem->setZValue(m_currentZ++);
rectItem->setTransformOriginPoint(m_currentBoxOrigin);
rectItem->setRotation(-m_currentBoxRotation);
m_currentGroup.append(rectItem);
m_inTextBox = false;
break;

However, with your test example, the above code doesn't get called. So
there are certainly some issues for Qt terminal.

Ethan, how well developed is the boxed label/text? Is this something
that needs more development and better left for a next release? Or
should a proper Qt fix be a simple matter?

Dan
sfeam via gnuplot-beta
2017-07-04 23:45:59 UTC
Permalink
Post by Daniel J Sebald
Post by sfeam via gnuplot-beta
More to the point... Is it only the "test" command that has a problem?
If so I don't think we really care that much. If boxed text in general is
failing that would be a bigger issue.
​Here is the output of a script;
​set label "1234567890" at 0,-0.4 boxed font "DejaVuSans, 5"
set label "1234567890" at 0,-0.2 boxed font "DejaVuSans, 7"
set label "1234567890" at 0,0 boxed font "DejaVuSans, 9"
set label "1234567890" at 0,0.2 boxed font "DejaVuSans, 12"
set label "1234567890" at 0,0.4 boxed font "DejaVuSans, 14"
set label "1234567890" at 0,0.6 boxed font "DejaVuSans, 18"
set label "1234567890" at 0,0.8 boxed font "DejaVuSans, 24"
plot sin(x)
One can see that the problem is still there at very small (and perhaps
very large) font sizes.
​The problem seems to be qt related. It looks fine reploted to e.g.
pngcairo.
With a rudimentary browsing of the code, it doesn't seem to me that we
should expect the boxed text to be too accurate. As for the test image,
it's
[snip]
which is only a rough estimate at the font-processed string width in
pixels, assuming a constant-width character. The test image code should
be placing a box similar to the way in with text/label items are placing
a box.
The code in "test" predates the boxed text option by many years.
It is, as you say, only a rough estimate. It used to be the best we could do.
Now the boxed text option is a better alternative.
Post by Daniel J Sebald
But even in the case of labels with the "boxed" qualifier, I don't see
any mechanism for either feeding the string width from the terminal back
to gnuplot so that it can draw a box,
Correct. The core code gets no feedback from the terminals.
For many terminals it is impossible even in theory (e.g. PostScript).
Post by Daniel J Sebald
or specifying to the terminal that
it should put a box around the text it is requesting.
Not correct. The boxed text option works exactly by telling the terminal
it should put a box around the next block of text that is sent.
The terminal does this by itself with no additional help from any core routines.

[snip]
Post by Daniel J Sebald
Ethan, how well developed is the boxed label/text?
There are additional options I would like to see added, but as to the
size of the bounding box It should be perfect for the terminals that
support it at all.
Post by Daniel J Sebald
Is this something
that needs more development and better left for a next release? Or
should a proper Qt fix be a simple matter?
For me the Qt output is perfect. The bounding box of an object is a
fundamental property in Qt. If Dmitri's Qt version is getting it wrong,
I'd say that is a serious bug in Qt. I found one bug report against
Qt 5.5.1 and 5.6beta that might be relevant, but the text bounding boxes
are fine on my machines with Qt 5.4.2 and 5.6.2

Ethan
Post by Daniel J Sebald
Dan
Daniel J Sebald
2017-07-05 00:53:29 UTC
Permalink
[snip]
Post by sfeam via gnuplot-beta
Post by Daniel J Sebald
But even in the case of labels with the "boxed" qualifier, I don't see
any mechanism for either feeding the string width from the terminal back
to gnuplot so that it can draw a box,
Correct. The core code gets no feedback from the terminals.
For many terminals it is impossible even in theory (e.g. PostScript).
Post by Daniel J Sebald
or specifying to the terminal that
it should put a box around the text it is requesting.
Not correct. The boxed text option works exactly by telling the terminal
it should put a box around the next block of text that is sent.
The terminal does this by itself with no additional help from any core routines.
OK, if that is the case, I'll look at this a little bit and see if I can
find anything.

Dan
Daniel J Sebald
2017-07-05 09:30:26 UTC
Permalink
Post by Daniel J Sebald
[snip]
Post by sfeam via gnuplot-beta
Post by Daniel J Sebald
But even in the case of labels with the "boxed" qualifier, I don't see
any mechanism for either feeding the string width from the terminal back
to gnuplot so that it can draw a box,
Correct. The core code gets no feedback from the terminals.
For many terminals it is impossible even in theory (e.g. PostScript).
Post by Daniel J Sebald
or specifying to the terminal that
it should put a box around the text it is requesting.
Not correct. The boxed text option works exactly by telling the terminal
it should put a box around the next block of text that is sent.
The terminal does this by itself with no additional help from any core routines.
OK, if that is the case, I'll look at this a little bit and see if I can
find anything.
I've posted an initial patch for Qt terminal alignment with this bug report:

https://sourceforge.net/p/gnuplot/bugs/1940/

There is a test plot screen capture there for you to look at. I think
it is going in the right direction, but needs some adjustment after
discussion.

Dan
Daniel J Sebald
2017-07-04 19:17:32 UTC
Permalink
[snip]
Post by Dmitri A. Sergatskov
Here is with dejavu sans mono 9 (this is actually the best fit I could
get --
it gets worse for either smaller or bigger sizes).
​(This is still on Gnome desktop).​
I notice in the example test plot that people have sent that there is an
extra space between the terminal name and the "terminal test". How
about the change in the attached diff file to make the terminal name
italic-bold and 1.5 times larger to illustrate multiple font features?
That looks pretty good and highlights the terminal in question, plus it
tests whether the user has a bold/italic font.

Dan
Daniel J Sebald
2017-07-04 19:31:20 UTC
Permalink
Also, I'm wondering about the default terminal sizes:

wxt: 640x384
qt: 640x480
x11: 640x450

not that it matters much; it's just that the WXT terminal test output
looks vertically scrunched compared to Qt. Other terminals such as PNG
use 640x480 default.

Dan
Post by Daniel J Sebald
[snip]
Post by Dmitri A. Sergatskov
Here is with dejavu sans mono 9 (this is actually the best fit I could
get --
it gets worse for either smaller or bigger sizes).
​(This is still on Gnome desktop).​
I notice in the example test plot that people have sent that there is an
extra space between the terminal name and the "terminal test". How
about the change in the attached diff file to make the terminal name
italic-bold and 1.5 times larger to illustrate multiple font features?
That looks pretty good and highlights the terminal in question, plus it
tests whether the user has a bold/italic font.
Dan
sfeam via gnuplot-beta
2017-07-04 20:37:43 UTC
Permalink
Post by Daniel J Sebald
wxt: 640x384
qt: 640x480
x11: 640x450
not that it matters much; it's just that the WXT terminal test output
looks vertically scrunched compared to Qt. Other terminals such as PNG
use 640x480 default.
Given that we're already at -rc2, let's limit any further changes to
actual bug fixes.

thanks,

Ethan
Tatsuro MATSUOKA
2017-07-05 11:43:25 UTC
Permalink
default terminal size

windows: depends on resolution on the current setting ?


Am I right?

Tatsuro



----- Original Message -----
Date: 2017/7/5, Wed 04:31
Subject: Re: 5.2 rc2 tarball now available
wxt: 640x384
qt: 640x480
x11: 640x450
not that it matters much; it's just that the WXT terminal test output
looks vertically scrunched compared to Qt.  Other terminals such as PNG
use 640x480 default.
Dan
Post by Daniel J Sebald
[snip]
Post by Dmitri A. Sergatskov
Here is with dejavu sans mono 9 (this is actually the best fit I could
get --
it gets worse for either smaller or bigger sizes).
​(This is still on Gnome desktop).​
I notice in the example test plot that people have sent that there is an
extra space between the terminal name and the "terminal test". 
How
Post by Daniel J Sebald
about the change in the attached diff file to make the terminal name
italic-bold and 1.5 times larger to illustrate multiple font features?
That looks pretty good and highlights the terminal in question, plus it
tests whether the user has a bold/italic font.
Dan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-beta mailing list
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
sfeam via gnuplot-beta
2017-07-04 17:56:03 UTC
Permalink
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
***
Is caca still experimental?
It's just fun, but it's nice, mouseable and it seems to work, so I propose to
have it not experimental.
Good point.
Also I have just noticed that the caca terminal documentation
is not always included in user manual.
Hmm. Maybe it still needs the EXPERIMENTAL warning.

I have not tried the caca terminal for a while, but here is what I see
when testing -rc2:

driver type raw: Segfaults immediately
(divide-by-zero because height and width are 0)
driver type ncurses: Many garbage characters in output stream
(incorrect handling of TERM setting?)
driver type x11: Font problems, many characters appear as
an empty box. Usable but could be better.

I have lib64caca0-0.99-0.beta18.10
Do you have a more recent version?

In any case I will make sure the documentation is included in the
user manual for 5.2

Ethan
Petr Mikulik
2017-07-04 23:08:35 UTC
Permalink
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite embarassing that a
compile needs googling to fix it locally.

Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?

---
Petr
sfeam via gnuplot-beta
2017-07-04 23:23:20 UTC
Permalink
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?

I'll go further and say it is a wxgtk bug that this should be visible
to the calling program at all. The calling program doesn't use or
need to know about libX11. If wxgtk wants to call into it, fine,
but why expose this to the calling program?

FWIW wxgtk 2.8 still works and doesn't have this problem.
It is only versions >= 2.9 that are broken.

Ethan
Daniel J Sebald
2017-07-05 01:07:53 UTC
Permalink
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?
Actually, I think this is gnuplot's responsibility. If I do

sebald@ ~ $ wx-config --libs
-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0
-lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0
-lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

in that list is "pthread" which I believe is to inform the gcc/c++
compiler that posix threads are to be used in compiling and linking. (I
think pthread is standard across compilers, but I'm not sure.) In other
words, it's supposed to be the responsibility of the compiler to deal
with all the threads issues so long as wxWidgets follows posix.

In the fix for this bug

http://gnuplot.10905.n7.nabble.com/crash-when-using-wxt-in-Ubuntu-12-04-td17318.html

the following line was added:

/* Define a new application type, each gui should derive a class from
wxApp */
class wxtApp : public wxApp
{
public:
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif

There's no way for wx-config to anticipate that this forced thread
initialization is going to appear in the code and that X11 library is
needed to satisfy that.

It could be that "-pthread" doesn't even use the X11 library but maybe
has it's own similar code. Maybe XInitThreads() is a hunk of code that
just happens to solve the internal linux issue.

So, I would say the problem is that the fix for that bug report linked
above, i.e., forcing XInitThreads(), isn't the proper way of going about
things. Let's find a proper way to fix that original bug. For
reference, wxWidgets multithreading is discussed here:

http://docs.wxwidgets.org/trunk/overview_thread.html

Dan
Daniel J Sebald
2017-07-05 01:17:42 UTC
Permalink
Post by Daniel J Sebald
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite
embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?
Actually, I think this is gnuplot's responsibility. If I do
-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0
-lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0
-lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
in that list is "pthread" which I believe is to inform the gcc/c++
compiler that posix threads are to be used in compiling and linking. (I
think pthread is standard across compilers, but I'm not sure.) In other
words, it's supposed to be the responsibility of the compiler to deal
with all the threads issues so long as wxWidgets follows posix.
In the fix for this bug
http://gnuplot.10905.n7.nabble.com/crash-when-using-wxt-in-Ubuntu-12-04-td17318.html
/* Define a new application type, each gui should derive a class from
wxApp */
class wxtApp : public wxApp
{
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif
I'm not having any problems building/running if I just comment out this
line. Then again, from my wx-config test, I might be using GTK2 rather
than GTK3, which might be the issue if "wxgtk3.0" is in the comment.

This looks to have been a thread from 2013. Maybe we should open a bug
report and move the discussion there in hopes of finding someone for
which that crash can be replicated when there is no XInitThreads().

Dan
Daniel J Sebald
2017-07-05 02:59:55 UTC
Permalink
Post by Daniel J Sebald
Post by Daniel J Sebald
/* Define a new application type, each gui should derive a class from
wxApp */
class wxtApp : public wxApp
{
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif
I'm not having any problems building/running if I just comment out this
line. Then again, from my wx-config test, I might be using GTK2 rather
than GTK3, which might be the issue if "wxgtk3.0" is in the comment.
This looks to have been a thread from 2013. Maybe we should open a bug
report and move the discussion there in hopes of finding someone for
which that crash can be replicated when there is no XInitThreads().
Actually, I can replicate the problem, and I found the bug report.
FWIW, I posted some comments and links here:

https://sourceforge.net/p/gnuplot/bugs/1401/?limit=25&page=1#aab6

I suspect a fix not involving manual XInitThreads() might be work beyond
the current release. (Is it that graphics/GUI action is taking place in
the secondary thread when it isn't supposed to?)

Anyway, I think gnuplot configure is obligated to add -lX11, given the
situation.

Dan
Petr Mikulik
2017-07-05 22:08:14 UTC
Permalink
Post by Daniel J Sebald
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu)
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?
Actually, I think this is gnuplot's responsibility. If I do
Anyway, I think gnuplot configure is obligated to add -lX11, given the
situation.
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not. Is
such a workaround possible?

---
Petr
Daniel J Sebald
2017-07-06 17:38:13 UTC
Permalink
Post by Petr Mikulik
Post by Daniel J Sebald
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some
Ubuntu) linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite
embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?
Actually, I think this is gnuplot's responsibility. If I do
Anyway, I think gnuplot configure is obligated to add -lX11, given the
situation.
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not.
Is such a workaround possible?
The necessary tests are already present. The hunks of code that matter
have pre-processor conditionals:

#if defined(WX_NEEDS_XINITTHREADS) && defined(X11)
#include <X11/Xlib.h> /* Magic fix for linking against wxgtk3.0 */
#endif

and WX_NEEDS_XINITTHREADS and X11 are defined from tests within the
configure process.

We only want to include library -lX11 for the building of wx_gui.cpp,
and there is a convenient definition for that:

Makefile:LIBRARIES_FOR_X = -lX11

The included libraries for wx_gui.cpp are gotten from the wx-config
command as discussed earlier, and it shows up as

Makefile:WX_LIBS = -L/usr/lib/x86_64-linux-gnu -pthread
-lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0
-lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0
-lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0

So, all we really need do is append LIBRARIES_FOR_X to WX_LIBS if
XInitThreads() is used in the wx_gui code. If X11 is not present,
LIBRARIES_FOR_X should be empty.

I've attached a six-line patch to the original bug report associated
with the inclusion of XInitThreads() here:

https://sourceforge.net/p/gnuplot/bugs/_discuss/thread/94192961/d1c5/attachment/gnuplot-wxlibs_xinitthreads_configure-djs2017jul06.patch

Dan
sfeam via gnuplot-beta
2017-07-06 18:23:24 UTC
Permalink
Post by Daniel J Sebald
Post by Petr Mikulik
Post by Daniel J Sebald
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
Post by sfeam via gnuplot-beta
Post by Petr Mikulik
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some
Ubuntu) linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
No. It is a bug in the configuration files distributed for libwxgtk.
Unfortunately it seems to be a wide-spread bug. It is quite embarassing that a
compile needs googling to fix it locally.
Cannot "./configure" take care of this? I.e. add the "-lX11" flag if
"something"?
That "something" is exactly the problem. Only some versions of
wxWidgets need this, and only for some configurations. The
wx-config tool is supposed to tell us what libraries are needed so
we can link them. But it doesn't mention X11. So how are we to know?
Actually, I think this is gnuplot's responsibility. If I do
Anyway, I think gnuplot configure is obligated to add -lX11, given the
situation.
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not.
Is such a workaround possible?
The necessary tests are already present. The hunks of code that matter
#if defined(WX_NEEDS_XINITTHREADS) && defined(X11)
#include <X11/Xlib.h> /* Magic fix for linking against wxgtk3.0 */
#endif
and WX_NEEDS_XINITTHREADS and X11 are defined from tests within the
configure process.
We only want to include library -lX11 for the building of wx_gui.cpp,
Makefile:LIBRARIES_FOR_X = -lX11
The included libraries for wx_gui.cpp are gotten from the wx-config
command as discussed earlier, and it shows up as
Makefile:WX_LIBS = -L/usr/lib/x86_64-linux-gnu -pthread
-lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0
-lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0
-lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0
So, all we really need do is append LIBRARIES_FOR_X to WX_LIBS if
XInitThreads() is used in the wx_gui code. If X11 is not present,
LIBRARIES_FOR_X should be empty.
I've attached a six-line patch to the original bug report associated
https://sourceforge.net/p/gnuplot/bugs/_discuss/thread/94192961/d1c5/attachment/gnuplot-wxlibs_xinitthreads_configure-djs2017jul06.patch
Unfortunately that doesn't work.

As it shows in the original bug report, wxgtk stupidly insists on the
XInitThreads business *even if the program doesn't use X11*.

So making gnuplot's configuration rely on LIBRARIES_FOR_X doesn't
resolve the original problem. It just moves the failure from compile-time
to run-time. You can test this by configuring like this:

./configure --without-x --without-gd --with-wx

Your patch allows it to compile without complaint, but then you get
a run-time failure instead because wxgtk aborts when it finds that
XInitThreads was not called.

This is actually worse than the compile-time failure because at that
point it's too late to fix the problem.
Hence the warning in the Release Notes.

Ethan


NB: --without-gd is there because the gd configure tool actually gets this right
and pulls in -lX11 if libgd wants it. If the wxgtk configure tool did the same
we wouldn't have this problem.
Post by Daniel J Sebald
Dan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-beta mailing list
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Ethan A Merritt via gnuplot-beta
2017-07-12 19:11:18 UTC
Permalink
Post by Petr Mikulik
Hello,
I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some Ubuntu) -
linking fails.
https://sourceforge.net/p/gnuplot/support-requests/196/
The workaround
configure --with-X11
described above does not help, while
TERMLIBS="-lX11" ./configure
let me gnuplot compile.
Can this be fixed?
***
Further, I can see that
set term qt; test
does not pass the test of character width (testing rectangle is too narrow),
while x11 and wxt pass well.
***
Those two dummy terminals show 90123456789 instead of 0123...90123...9 in the
set term dumb; test
set term caca; test
***
Is caca still experimental?
It's just fun, but it's nice, mouseable and it seems to work, so I propose to
have it not experimental.
***
Greetings,
Petr
Updates:

1) Auto-detection of a wxt on linux requirement for
TERMLIBS="-lX11" ./configure

No solution. The weak point is the wxgtk3 library.
It has several runtime glitches in addition to this configuration issue.
I do not expect a fix for 5.2 This is a real problem but I don't see
anything we can do about it other than to recommend against using wxgtk
versions higher than 2.8

2) Qt text boxes

I have modified the "test" command to show both the true bounding box
as used by the current terminal (shaded rectangle) and the generic
estimated bounding box used by the core program to reserve space for
text in a plot layout. It seems some Qt versions report an inaccurate
bounding box width for some fonts (e.g. Qt 5.6.2 + DejaVu Sans).
Nevertheless the terminal's internal bounding box is always more accurate
than the generic estimated box.

Dan Sebald has pointed out that the Qt terminal and the cairo terminals
differ in whether they increase the lower bound of the bounding box to
allow for font descenders. This is probably fixable but I consider it a
minor issue.

3) caca terminal still EXPERIMENTAL?

I have libcaca 0.99 beta18. The gnuplot caca terminal reports:
set term caca driver list
x11 gl slang ncurses raw null

For me the x11 and gl options are usable although the x11 font handling
has artifacts. slang and ncurses spew garbage. raw and null cause
segfaults. Most of the time changing a caca option causes gnuplot to exit.
So yes, I think we need to warn that the caca terminal is still EXPERIMENTAL.

4) autoconfigure/compile on SunOS

Minor issues only. The demo for building and linking plugins does
not autoconfigure correction but can be built manually following instructions
in the plugin demo Makefile.
See also various notes attached to Bug #1821

5) Unwanted inclusion of Type 3 fonts in cairo pdf output

The is Bug #1868. No fix known. Not a release-blocker.
It would be great if someone would pursue this with the cairographics
project maintainers.

6) Any other known issues?

Ethan
Tatsuro MATSUOKA
2017-07-13 22:36:26 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
6) Any other known issues?
     Ethan
This is not an issue but documentation problem for source distribution.
In source distribution, there is a file named "INSTALL".
It is well written but some parts are obsoleted or inadequate.

e.g.

1.
Unix, configure
---------------
   
TERMLIBS="-lX11" ./configure
is required for wxwidgets but is not described

2.
MS-Windows
----------

There's no installer for gnuplot, so if you want a desktop link,
program manager group or an association of *.plt or *.gpl files to
wgnuplot, you'll have to do all that yourself.

The gnuplot for windows has installer now.


*********************
There are much points which are not up-to-date.
Is it better open a bug ticket for "INSTALL" being up-to-date?

Tatsuro
Ethan A Merritt via gnuplot-beta
2017-07-13 23:48:17 UTC
Permalink
Post by Tatsuro MATSUOKA
Post by Ethan A Merritt via gnuplot-beta
6) Any other known issues?
Ethan
This is not an issue but documentation problem for source distribution.
In source distribution, there is a file named "INSTALL".
It is well written but some parts are obsoleted or inadequate.
e.g.
1.
Unix, configure
---------------
TERMLIBS="-lX11" ./configure
is required for wxwidgets but is not described
2.
MS-Windows
----------
There's no installer for gnuplot, so if you want a desktop link,
program manager group or an association of *.plt or *.gpl files to
wgnuplot, you'll have to do all that yourself.
The gnuplot for windows has installer now.
*********************
There are much points which are not up-to-date.
Good point.
The FAQ, the man page, and the LaTeX tutorial are even more out of date.
Contributions are welcome for all of these.

The same is true for the web site.
The front page is not bad, but the linked pages are getting stale.
Post by Tatsuro MATSUOKA
Is it better open a bug ticket for "INSTALL" being up-to-date?
A bug ticket is less useful than a patch containing new text.
Or contribute new text by posting it here on the mailing list.

Ethan
Post by Tatsuro MATSUOKA
Tatsuro
Jim Mehl
2017-07-14 00:20:57 UTC
Permalink
INSTALL currently contains

Ubuntu:
./configure fails to find lua support because Ubuntu packages it as
"lua5.1" rather than "lua". You can fix this by adding a symlink
prior to running ./configure
ln -s /usr/lib/pkgconfig/lua5.1.pc /usr/lib/pkgconfig/lua.pc

Installation on linux mint mate 18.2 (based on Ubuntu 16.04) did not
require this link.

For older 64 bit systems this should be changed to (update "5.1" to
current version):
ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/lua5.1.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua.pc
Post by sfeam via gnuplot-beta
Post by Tatsuro MATSUOKA
Post by Ethan A Merritt via gnuplot-beta
6) Any other known issues?
Ethan
This is not an issue but documentation problem for source distribution.
In source distribution, there is a file named "INSTALL".
It is well written but some parts are obsoleted or inadequate.
e.g.
1.
Unix, configure
---------------
TERMLIBS="-lX11" ./configure
is required for wxwidgets but is not described
2.
MS-Windows
----------
There's no installer for gnuplot, so if you want a desktop link,
program manager group or an association of *.plt or *.gpl files to
wgnuplot, you'll have to do all that yourself.
The gnuplot for windows has installer now.
*********************
There are much points which are not up-to-date.
Good point.
The FAQ, the man page, and the LaTeX tutorial are even more out of date.
Contributions are welcome for all of these.
The same is true for the web site.
The front page is not bad, but the linked pages are getting stale.
Post by Tatsuro MATSUOKA
Is it better open a bug ticket for "INSTALL" being up-to-date?
A bug ticket is less useful than a patch containing new text.
Or contribute new text by posting it here on the mailing list.
Ethan
Post by Tatsuro MATSUOKA
Tatsuro
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-beta mailing list
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Bastian Märkisch
2017-07-14 05:12:27 UTC
Permalink
Gesendet: Freitag, 14. Juli 2017 um 01:48 Uhr
Betreff: Re: 5.2 rc2 tarball now available
Post by Tatsuro MATSUOKA
Post by Ethan A Merritt via gnuplot-beta
6) Any other known issues?
Ethan
This is not an issue but documentation problem for source distribution.
In source distribution, there is a file named "INSTALL".
It is well written but some parts are obsoleted or inadequate.
e.g.
1.
Unix, configure
---------------
TERMLIBS="-lX11" ./configure
is required for wxwidgets but is not described
2.
MS-Windows
----------
There's no installer for gnuplot, so if you want a desktop link,
program manager group or an association of *.plt or *.gpl files to
wgnuplot, you'll have to do all that yourself.
The gnuplot for windows has installer now.
*********************
There are much points which are not up-to-date.
Good point.
The FAQ, the man page, and the LaTeX tutorial are even more out of date.
Contributions are welcome for all of these.
The same is true for the web site.
The front page is not bad, but the linked pages are getting stale.
Post by Tatsuro MATSUOKA
Is it better open a bug ticket for "INSTALL" being up-to-date?
A bug ticket is less useful than a patch containing new text.
Or contribute new text by posting it here on the mailing list.
Ethan
Post by Tatsuro MATSUOKA
Tatsuro
There's now a revision of the MS-Windows INSTALL section in CVS for 5.2.

Bastian
Tatsuro MATSUOKA
2017-07-14 09:01:54 UTC
Permalink
----- Original Message -----
Post by Bastian Märkisch
Post by Tatsuro MATSUOKA
2.
MS-Windows
----------
There's no installer for gnuplot, so if you want a desktop link,
program manager group or an association of *.plt or *.gpl files to
wgnuplot, you'll have to do all that yourself.
The gnuplot for windows has installer now.
*********************
There are much points which are not up-to-date.
There's now a revision of the MS-Windows INSTALL section in CVS for 5.2.
  Bastian
Thanks for change.
INSTALL tells that now mingw toolkits are MinGW64/MSYS2 but not MINGW/MSYS.
I think that description of config/mingw/Makefile it to be changed in corresponding way.

Tatsuro

Bastian Märkisch
2017-07-14 04:34:19 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
2) Qt text boxes
I have modified the "test" command to show both the true bounding box
as used by the current terminal (shaded rectangle) and the generic
estimated bounding box used by the core program to reserve space for
text in a plot layout. It seems some Qt versions report an inaccurate
bounding box width for some fonts (e.g. Qt 5.6.2 + DejaVu Sans).
Nevertheless the terminal's internal bounding box is always more accurate
than the generic estimated box.
Dan Sebald has pointed out that the Qt terminal and the cairo terminals
differ in whether they increase the lower bound of the bounding box to
allow for font descenders. This is probably fixable but I consider it a
minor issue.
For the Windows terminal the new grey box in the "test" output is much
larger than the "estimated" bounding box. That should be fixed.
Post by Ethan A Merritt via gnuplot-beta
3) caca terminal still EXPERIMENTAL?
set term caca driver list
x11 gl slang ncurses raw null
For me the x11 and gl options are usable although the x11 font handling
has artifacts. slang and ncurses spew garbage. raw and null cause
segfaults. Most of the time changing a caca option causes gnuplot to exit.
So yes, I think we need to warn that the caca terminal is still EXPERIMENTAL.
Moreover caca does currently not accept keyboard or mouse input in wgnuplot.
(But works using console mode gnuplot on Windows).
Btw. if ncurses or slang drivers work strongly depends on the terminal used.
Post by Ethan A Merritt via gnuplot-beta
4) autoconfigure/compile on SunOS
Minor issues only. The demo for building and linking plugins does
not autoconfigure correction but can be built manually following instructions
in the plugin demo Makefile.
See also various notes attached to Bug #1821
5) Unwanted inclusion of Type 3 fonts in cairo pdf output
The is Bug #1868. No fix known. Not a release-blocker.
It would be great if someone would pursue this with the cairographics
project maintainers.
6) Any other known issues?
The qt terminal on Windows has several known issues without known solution:

1. Slow start-up of first plot command: On my system the first plot in a
session is only shown with as much as 8 seconds delay. As indicated by Dan
Sebald, this might (again) be related to fontconfig, see also Octave bug
https://savannah.gnu.org/bugs/?45458 . We had that problem before with
cairo/pango based terminals and first solved it by adding additional
configuration files to the binary distribution (and later by not using
fontconfig any more).
2. After space-raise-console, the first character which is input on the
command line is lost.
3. replot-on-resize does not work as intended, see bug #1081. We should
mention this in the release notes and recommend to turn that feature off
for now.

Bastian
sfeam via gnuplot-beta
2017-07-14 06:19:29 UTC
Permalink
Post by Bastian Märkisch
Post by Ethan A Merritt via gnuplot-beta
2) Qt text boxes
I have modified the "test" command to show both the true bounding box
as used by the current terminal (shaded rectangle) and the generic
estimated bounding box used by the core program to reserve space for
text in a plot layout. It seems some Qt versions report an inaccurate
bounding box width for some fonts (e.g. Qt 5.6.2 + DejaVu Sans).
Nevertheless the terminal's internal bounding box is always more accurate
than the generic estimated box.
Dan Sebald has pointed out that the Qt terminal and the cairo terminals
differ in whether they increase the lower bound of the bounding box to
allow for font descenders. This is probably fixable but I consider it a
minor issue.
For the Windows terminal the new grey box in the "test" output is much
larger than the "estimated" bounding box. That should be fixed.
Hmm. The idea is that the "test" output is a diagnostic. If you see problems
there then maybe something needs to be fixed in the terminal code.
The grey box is draw using essentially "set label boxed noborder fc 'gray'".
So if it is too large then it is a diagnostic that the textbox code draws
too-large boxes. The estimated bounding box uses essentially
the same code as in boundary.c where the size of plot elements, titles,
key entries, etc are estimated. If the the "test" output shows a poor fit
then it is a diagnostic that term->h_char and term->v_char are non-optimal.
Post by Bastian Märkisch
Post by Ethan A Merritt via gnuplot-beta
3) caca terminal still EXPERIMENTAL?
set term caca driver list
x11 gl slang ncurses raw null
For me the x11 and gl options are usable although the x11 font handling
has artifacts. slang and ncurses spew garbage. raw and null cause
segfaults. Most of the time changing a caca option causes gnuplot to exit.
So yes, I think we need to warn that the caca terminal is still EXPERIMENTAL.
Moreover caca does currently not accept keyboard or mouse input in wgnuplot.
(But works using console mode gnuplot on Windows).
Btw. if ncurses or slang drivers work strongly depends on the terminal used.
I know that's the theory but so far as I can tell it makes no difference at
all what the TERM environmental variable is set to. That seems to indicate
that ncurses is not working the way it is supposed to. I'm not sure whether
the problem is in ncurses or libcaca or caca.trm. Or the terminal itself,
come to think of it. I have tried only xterm and konsole.
Post by Bastian Märkisch
Post by Ethan A Merritt via gnuplot-beta
4) autoconfigure/compile on SunOS
Minor issues only. The demo for building and linking plugins does
not autoconfigure correction but can be built manually following instructions
in the plugin demo Makefile.
See also various notes attached to Bug #1821
5) Unwanted inclusion of Type 3 fonts in cairo pdf output
The is Bug #1868. No fix known. Not a release-blocker.
It would be great if someone would pursue this with the cairographics
project maintainers.
6) Any other known issues?
1. Slow start-up of first plot command: On my system the first plot in a
session is only shown with as much as 8 seconds delay. As indicated by Dan
Sebald, this might (again) be related to fontconfig, see also Octave bug
https://savannah.gnu.org/bugs/?45458 . We had that problem before with
cairo/pango based terminals and first solved it by adding additional
configuration files to the binary distribution (and later by not using
fontconfig any more).
2. After space-raise-console, the first character which is input on the
command line is lost.
That sounds fixable. Probably the same fix applied for "pause mouse".

I know I sound like a broken record, but I really hate space-raises-console.
Surely there are better fixes that prevent focus-stealing proactively
rather than requiring you to grab it back by hitting an extra space key.
Post by Bastian Märkisch
3. replot-on-resize does not work as intended, see bug #1081. We should
mention this in the release notes and recommend to turn that feature off
for now.
Bastian
OK. All of these should be mentioned in "Known Issues" in the
release notes. Unless they are fixed of course.

Ethan
Daniel J Sebald
2017-07-06 18:59:04 UTC
Permalink
[snip]
Post by sfeam via gnuplot-beta
Post by Daniel J Sebald
Post by Petr Mikulik
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not.
Is such a workaround possible?
The necessary tests are already present. The hunks of code that matter
#if defined(WX_NEEDS_XINITTHREADS) && defined(X11)
#include <X11/Xlib.h> /* Magic fix for linking against wxgtk3.0 */
#endif
and WX_NEEDS_XINITTHREADS and X11 are defined from tests within the
configure process.
We only want to include library -lX11 for the building of wx_gui.cpp,
Makefile:LIBRARIES_FOR_X = -lX11
The included libraries for wx_gui.cpp are gotten from the wx-config
command as discussed earlier, and it shows up as
Makefile:WX_LIBS = -L/usr/lib/x86_64-linux-gnu -pthread
-lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0
-lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0
-lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0
So, all we really need do is append LIBRARIES_FOR_X to WX_LIBS if
XInitThreads() is used in the wx_gui code. If X11 is not present,
LIBRARIES_FOR_X should be empty.
I've attached a six-line patch to the original bug report associated
https://sourceforge.net/p/gnuplot/bugs/_discuss/thread/94192961/d1c5/attachment/gnuplot-wxlibs_xinitthreads_configure-djs2017jul06.patch
Unfortunately that doesn't work.
As it shows in the original bug report, wxgtk stupidly insists on the
XInitThreads business *even if the program doesn't use X11*.
So making gnuplot's configuration rely on LIBRARIES_FOR_X doesn't
resolve the original problem. It just moves the failure from compile-time
./configure --without-x --without-gd --with-wx
Your patch allows it to compile without complaint, but then you get
a run-time failure instead because wxgtk aborts when it finds that
XInitThreads was not called.
This is actually worse than the compile-time failure because at that
point it's too late to fix the problem.
Hence the warning in the Release Notes.
I see your point. However, the user is requesting no X11, the
consequence of which is a crash. We could drop the "&& defined(X11)" in
which case configuration will succeed but compilation then fail. That's
probably no better, so in addition to that we could place an error in
configure.ac when wx_needs_xinitthreads is "yes" and X11 is not present.
Post by sfeam via gnuplot-beta
NB: --without-gd is there because the gd configure tool actually gets this right
and pulls in -lX11 if libgd wants it. If the wxgtk configure tool did the same
we wouldn't have this problem.
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't anticipate our
use of an X function. wx_gui shouldn't be using XInitThreads(). I
suspect that something in the code outside the main thread is doing
something graphics related, but that's much too complex to address in
the near term.

Dan
Ethan A Merritt via gnuplot-beta
2017-07-06 19:28:15 UTC
Permalink
Post by Daniel J Sebald
[snip]
Post by sfeam via gnuplot-beta
Post by Daniel J Sebald
Post by Petr Mikulik
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not.
Is such a workaround possible?
The necessary tests are already present. The hunks of code that matter
#if defined(WX_NEEDS_XINITTHREADS) && defined(X11)
#include <X11/Xlib.h> /* Magic fix for linking against wxgtk3.0 */
#endif
and WX_NEEDS_XINITTHREADS and X11 are defined from tests within the
configure process.
We only want to include library -lX11 for the building of wx_gui.cpp,
Makefile:LIBRARIES_FOR_X = -lX11
The included libraries for wx_gui.cpp are gotten from the wx-config
command as discussed earlier, and it shows up as
Makefile:WX_LIBS = -L/usr/lib/x86_64-linux-gnu -pthread
-lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0
-lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0
-lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0
So, all we really need do is append LIBRARIES_FOR_X to WX_LIBS if
XInitThreads() is used in the wx_gui code. If X11 is not present,
LIBRARIES_FOR_X should be empty.
I've attached a six-line patch to the original bug report associated
https://sourceforge.net/p/gnuplot/bugs/_discuss/thread/94192961/d1c5/attachment/gnuplot-wxlibs_xinitthreads_configure-djs2017jul06.patch
Unfortunately that doesn't work.
As it shows in the original bug report, wxgtk stupidly insists on the
XInitThreads business *even if the program doesn't use X11*.
So making gnuplot's configuration rely on LIBRARIES_FOR_X doesn't
resolve the original problem. It just moves the failure from compile-time
./configure --without-x --without-gd --with-wx
Your patch allows it to compile without complaint, but then you get
a run-time failure instead because wxgtk aborts when it finds that
XInitThreads was not called.
This is actually worse than the compile-time failure because at that
point it's too late to fix the problem.
Hence the warning in the Release Notes.
I see your point. However, the user is requesting no X11, the
consequence of which is a crash. We could drop the "&& defined(X11)" in
which case configuration will succeed but compilation then fail. That's
probably no better, so in addition to that we could place an error in
configure.ac when wx_needs_xinitthreads is "yes" and X11 is not present.
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't anticipate our
use of an X function.
No! no! no!
You've got this exactly backwards.
The _only_ reason gnuplot calls XInitThreads is because otherwise
wxgtk aborts. The call was inserted in gnuplot to work around
precisely this wxgtk bug. Gnuplot itself makes no other calls into
the X11 library.

IMHO this is clearly a wxgtk library bug, introduced in version 2.9.
If it really wants a call to XInitThreads, let it make that call
itself rather than issuing a useless error message and aborting.

I'm afraid the reliability of the wxgtk library dropped significantly
after version 2.8. See for example Allin Cotrell's problem from
earlier today. My recommendation is that if you can link gnuplot
against wxgtk 2.8 rather than 2.9 or 3.0 you should do so.

Ethan
Daniel J Sebald
2017-07-06 21:27:00 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
Post by Daniel J Sebald
[snip]
Post by sfeam via gnuplot-beta
Post by Daniel J Sebald
Post by Petr Mikulik
I think that ./configure is the place for tests of compile conditions.
There can be some simple case testing whether "-lX11" is needed or not.
Is such a workaround possible?
The necessary tests are already present. The hunks of code that matter
#if defined(WX_NEEDS_XINITTHREADS) && defined(X11)
#include <X11/Xlib.h> /* Magic fix for linking against wxgtk3.0 */
#endif
and WX_NEEDS_XINITTHREADS and X11 are defined from tests within the
configure process.
We only want to include library -lX11 for the building of wx_gui.cpp,
Makefile:LIBRARIES_FOR_X = -lX11
The included libraries for wx_gui.cpp are gotten from the wx-config
command as discussed earlier, and it shows up as
Makefile:WX_LIBS = -L/usr/lib/x86_64-linux-gnu -pthread
-lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0
-lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0
-lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0
So, all we really need do is append LIBRARIES_FOR_X to WX_LIBS if
XInitThreads() is used in the wx_gui code. If X11 is not present,
LIBRARIES_FOR_X should be empty.
I've attached a six-line patch to the original bug report associated
https://sourceforge.net/p/gnuplot/bugs/_discuss/thread/94192961/d1c5/attachment/gnuplot-wxlibs_xinitthreads_configure-djs2017jul06.patch
Unfortunately that doesn't work.
As it shows in the original bug report, wxgtk stupidly insists on the
XInitThreads business *even if the program doesn't use X11*.
So making gnuplot's configuration rely on LIBRARIES_FOR_X doesn't
resolve the original problem. It just moves the failure from compile-time
./configure --without-x --without-gd --with-wx
Your patch allows it to compile without complaint, but then you get
a run-time failure instead because wxgtk aborts when it finds that
XInitThreads was not called.
This is actually worse than the compile-time failure because at that
point it's too late to fix the problem.
Hence the warning in the Release Notes.
I see your point. However, the user is requesting no X11, the
consequence of which is a crash. We could drop the "&& defined(X11)" in
which case configuration will succeed but compilation then fail. That's
probably no better, so in addition to that we could place an error in
configure.ac when wx_needs_xinitthreads is "yes" and X11 is not present.
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't anticipate our
use of an X function.
No! no! no!
You've got this exactly backwards.
The _only_ reason gnuplot calls XInitThreads is because otherwise
wxgtk aborts. The call was inserted in gnuplot to work around
precisely this wxgtk bug. Gnuplot itself makes no other calls into
the X11 library.
IMHO this is clearly a wxgtk library bug, introduced in version 2.9.
If it really wants a call to XInitThreads, let it make that call
itself rather than issuing a useless error message and aborting.
I'm afraid the reliability of the wxgtk library dropped significantly
after version 2.8. See for example Allin Cotrell's problem from
earlier today. My recommendation is that if you can link gnuplot
against wxgtk 2.8 rather than 2.9 or 3.0 you should do so.
Things may have simply changed with gtk 3.0 such that it isn't as
forgiving in some respects, I don't know. Security issues, etc. I
haven't looked at any of WX or GTK code, but I suspect that WX is going
a posix route and just doesn't concern itself with the X-windows levels.
I'm guessing that because the notes of wxThread state:

http://docs.wxwidgets.org/trunk/classwx_thread.html

"There are two types of threads in wxWidgets: detached and joinable,
modeled after the POSIX thread API."

I'm holding off on the conclusion that GTK overlooked using
XInitThreads() somewhere because it could be gnuplot's fault for doing
graphics in a secondary thread. Maybe the secondary thread is sending
some graphics X code through the system that shouldn't be present.
That's speculation; but here is what the wxThread documentation says:

http://docs.wxwidgets.org/trunk/classwx_thread.html

"
wxWidgets Calls in Secondary Threads

All threads other than the "main application thread" (the one running
wxApp::OnInit() or the one your main function runs in, for example) are
considered "secondary threads".

GUI calls, such as those to a wxWindow or wxBitmap are explicitly not
safe at all in secondary threads and could end your application
prematurely. This is due to several reasons, including the underlying
native API and the fact that wxThread does not run a GUI event loop
similar to other APIs as MFC.

A workaround for some wxWidgets ports is calling wxMutexGUIEnter()
before any GUI calls and then calling wxMutexGUILeave() afterwords.
However, the recommended way is to simply process the GUI calls in the
main thread through an event that is posted by wxQueueEvent(). This does
not imply that calls to these classes are thread-safe, however, as most
wxWidgets classes are not thread-safe, including wxString.
"

The second paragraph above could be very relevant (Qt has this same
restriction). This is what I'm trying to figure out: Is wx_gui doing
graphics in the secondary thread? The third paragraph too might be
important, as I see the following in the custom wxtThread::Entry() function:

/* Workaround for a deadlock when the main thread will Wait() for this one.
* This issue comes from the fact that our gui main loop is not in the
* main thread as wxWidgets was written for. */
wxt_MutexGuiLeave();

I activated FPRINTF() in wxt_gui.cpp to see at what point the process
exits prematurely:

Terminal type is now 'wxt'
Options are '0 enhanced'
gnuplot> plot sin(x)
Init
First Init
OnInit
OnInit finished
First Init2
opening a new plot window
secondary thread entry
wxtApp::OnCreateWindow
wxtFrame constructor
wxtFrame constructor 2
frame OnSize
panel constructor
panel constructor4
wxt_cairo_create_context
panel constructor5
panel constructor6
wxtFrame constructor 3
frame OnSize
panel OnSize 640 384 7680.000000 7680.000000
wxt_cairo_create_context
wxt_cairo_refresh called before window exists
new plot window opened
Init finished
Graphics xmax 12800 ymax 7680 v_char 339 h_char 160
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has
not been called
[xcb] Aborting, sorry about that.
gnuplot: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion
`!xcb_xlib_unknown_req_in_deq' failed.
Aborted

It looks like "new plot window opened" might be the source, i.e.,
wxWindow. Recall there is lag in processing X so it isn't necessarily
the last commands that are the source.

Again, it takes a little while to digest thread code, but inside
wxtThread::Entry() is the following:

/* gui loop */
wxTheApp->OnRun();

/* Workaround for a deadlock when the main thread will Wait() for this one.
* This issue comes from the fact that our gui main loop is not in the
* main thread as wxWidgets was written for. */
wxt_MutexGuiLeave();

Is this "gui loop" indicating that the GUI is in fact being run in the
secondary thread? Or is it just launching something from the secondary
thread? I'm starting to get the feeling this might explain why I often
see the WXT terminal plot windows not close when I exit gnuplot. (It's
time consuming to close all windows individually.)

So, what I'm going on at this point is:

1) It looks like the graphics may be running in a secondary thread.

2) wxWidgets documentation states "GUI calls are explicitly not safe at
all in secondary threads and could end your application prematurely."

The contra-positive logic doesn't necessarily conclude that the source
of the problem therefore lies in gnuplot. Plus it is a lot of work to
test the theory that rearranging wx_gui so that GUI manipulation is only
done in the main thread. So, for me it's inconclusive from my
understanding just who's responsible for the need for XInitThreads().

Dan
Ethan A Merritt via gnuplot-beta
2017-07-06 22:03:29 UTC
Permalink
Post by Daniel J Sebald
1) It looks like the graphics may be running in a secondary thread.
2) wxWidgets documentation states "GUI calls are explicitly not safe at
all in secondary threads and could end your application prematurely."
The contra-positive logic doesn't necessarily conclude that the source
of the problem therefore lies in gnuplot. Plus it is a lot of work to
test the theory that rearranging wx_gui so that GUI manipulation is only
done in the main thread. So, for me it's inconclusive from my
understanding just who's responsible for the need for XInitThreads().
Dan
So do all the errors go away if you do

./configure --with-wx-single-threaded

(still omitting the call to XInitThreads and not linking to -lX11).

Ethan
Daniel J Sebald
2017-07-06 22:19:53 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
Post by Daniel J Sebald
1) It looks like the graphics may be running in a secondary thread.
2) wxWidgets documentation states "GUI calls are explicitly not safe at
all in secondary threads and could end your application prematurely."
The contra-positive logic doesn't necessarily conclude that the source
of the problem therefore lies in gnuplot. Plus it is a lot of work to
test the theory that rearranging wx_gui so that GUI manipulation is only
done in the main thread. So, for me it's inconclusive from my
understanding just who's responsible for the need for XInitThreads().
Dan
So do all the errors go away if you do
./configure --with-wx-single-threaded
(still omitting the call to XInitThreads and not linking to -lX11).
Yes, on the crash (plot is successful):

gnuplot> set term wxt

Terminal type is now 'wxt'
Options are '0 enhanced'
gnuplot> plot sin(x)
Init
First Init
OnInit
OnInit finished
First Init2
opening a new plot window
wxtApp::OnCreateWindow
wxtFrame constructor
wxtFrame constructor 2
frame OnSize
panel constructor
panel constructor4
wxt_cairo_create_context
panel constructor5
panel constructor6
wxtFrame constructor 3
frame OnSize
panel OnSize 640 384 7680.000000 7680.000000
wxt_cairo_create_context
wxt_cairo_refresh called before window exists
new plot window opened
Init finished
Graphics xmax 12800 ymax 7680 v_char 339 h_char 160
raise window
frame OnSize
Graphics xmax 12800 ymax 7680 v_char 339 h_char 160
raise window
gnuplot> exit
wxt_atexit: handling "persist" setting
Checking window 0 : shown
parent process: exiting, child process has PID 6255
wxt_cleanup: start
wxtApp::OnExit
child process: running
child process: restarting its event loop
panel destructor
wxt_cleanup: finished
wxt_reset

No, on the closing of the plot window at exit. It is still persistent
after exit. I'll look into the code around "Checking window 0" if there
might be something else at play.

Dan
Daniel J Sebald
2017-07-06 23:32:42 UTC
Permalink
Post by Daniel J Sebald
No, on the closing of the plot window at exit. It is still persistent
after exit. I'll look into the code around "Checking window 0" if there
might be something else at play.
OK, this one was O.E. I looked in the window's configuration dialog and
saw that there is a "persist" variable active. I must have set that a
long time ago not realizing it is remembered between sessions, not
present-session-only.
There is a minor issue, which is that 'persist' and other wxConfig
settings are stored at wxt-window exit, rather than at the point of "OK"
or "Apply". Say for example:

1) Run 'gnuplot' and generate a WXT terminal window. Exit when
'persist' is active, the window stays on screen.

2) Run 'gnuplot' again, generate a WXT plot and turn off 'persist'.
Exit and the most recent plot window closes, but the older plot is still
persistent, that's fine.

3) But now close that older plot window and 'persist' is turned back on
the next time gnuplot is run.

Rare circumstances, and probably not worth a bug fix.

Dan
p***@piments.com
2017-07-07 13:11:36 UTC
Permalink
Post by Daniel J Sebald
Post by Daniel J Sebald
No, on the closing of the plot window at exit. It is still persistent
after exit. I'll look into the code around "Checking window 0" if there
might be something else at play.
OK, this one was O.E. I looked in the window's configuration dialog and
saw that there is a "persist" variable active. I must have set that a
long time ago not realizing it is remembered between sessions, not
present-session-only.
There is a minor issue, which is that 'persist' and other wxConfig
settings are stored at wxt-window exit, rather than at the point of "OK"
1) Run 'gnuplot' and generate a WXT terminal window. Exit when
'persist' is active, the window stays on screen.
2) Run 'gnuplot' again, generate a WXT plot and turn off 'persist'. Exit
and the most recent plot window closes, but the older plot is still
persistent, that's fine.
3) But now close that older plot window and 'persist' is turned back on
the next time gnuplot is run.
Rare circumstances, and probably not worth a bug fix.
Dan
----------
Why is persist being stored anywhere? Surlely this is just flag to
gnuplot for whether to close the plot window on the way out.

How is this a wxt config option which needs to be stored anywhere. It
seems like faulty logic to me.

Peter.
Daniel J Sebald
2017-07-07 01:08:35 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
Post by Daniel J Sebald
1) It looks like the graphics may be running in a secondary thread.
2) wxWidgets documentation states "GUI calls are explicitly not safe at
all in secondary threads and could end your application prematurely."
The contra-positive logic doesn't necessarily conclude that the source
of the problem therefore lies in gnuplot. Plus it is a lot of work to
test the theory that rearranging wx_gui so that GUI manipulation is only
done in the main thread. So, for me it's inconclusive from my
understanding just who's responsible for the need for XInitThreads().
Dan
So do all the errors go away if you do
./configure --with-wx-single-threaded
(still omitting the call to XInitThreads and not linking to -lX11).
However, wx-single-threaded doesn't work for multiple windows for me.
The first plot is fine. But then

raise window
gnuplot> set term wxt 1
wxt_reset
wxt_reset ends

Terminal type is now 'wxt'
Options are '1 enhanced'
gnuplot> plot sin(x)
[repeated about 300 times or more]
Init
opening a new plot window
wxtApp::OnCreateWindow
wxtFrame constructor
wxtFrame constructor 2
frame OnSize
Init
opening a new plot window
wxtApp::OnCreateWindow
wxtFrame constructor
wxtFrame constructor 2
frame OnSize
Init
opening a new plot window
Segmentation fault

Maybe a stack overflow is the segfault. Why it keeps opening new
windows (that don't appear visually), I don't know.

Dan
Allin Cottrell
2017-07-06 19:13:44 UTC
Permalink
Post by Daniel J Sebald
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't
anticipate our use of an X function. wx_gui shouldn't be using
XInitThreads().
I'd just like to underscore Daniel's last point here. Surely it's a
dangerous hack for the gnuplot code to call XInitThreads() "on
behalf of" wxWidgets (in wxt_gui.h). I suspect this may be related
to the segfault I reported earlier today.

<danger-will-robinson>
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif
</danger-will-robinson>

Allin Cottrell
Ethan A Merritt via gnuplot-beta
2017-07-06 20:13:42 UTC
Permalink
Post by Allin Cottrell
Post by Daniel J Sebald
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't
anticipate our use of an X function. wx_gui shouldn't be using
XInitThreads().
I'd just like to underscore Daniel's last point here. Surely it's a
dangerous hack for the gnuplot code to call XInitThreads() "on
behalf of" wxWidgets (in wxt_gui.h). I suspect this may be related
to the segfault I reported earlier today.
<danger-will-robinson>
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif
</danger-will-robinson>
[shrug]
I agree it is stupid that wxgtk does not perform its own initialization.
But it doesn't.

I refer you to the output from wxgtk if this call is omitted:

Call stack:
[00] wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)
[01] wxClientDCImpl::DoGetSize(int*, int*) const
[02] wxBufferedDC::UnMask()
[03] ~wxDC /usr/include/wx-3.0/wx/dc.h:789
[04] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[05] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[06] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[07] wxEvtHandler::TryHereOnly(wxEvent&)
[08] wxEvtHandler::ProcessEventLocally(wxEvent&)
[09] wxEvtHandler::ProcessEvent(wxEvent&)
[10] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[11] 0x7f22e8025ee1
[12] g_closure_invoke
[13] 0x7f22e6af0aad
[14] g_signal_emit_valist
[15] g_signal_emit
[16] gtk_widget_size_allocate
[17] 0x7f22e8024ff3
[18] g_closure_invoke
[19] 0x7f22e6af02c7
[20] g_signal_emit_valist
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.

I can suggest only 3 other options:

1) Link against wxgtk 2.8 rather than anything newer.
These problems only began after libgtk was substantially revised
in version 2.9

2) Try ./configure --with-wx-single-threaded
This never did much for me, but other people have reported better luck

3) Give up on the wxt terminal and use qt instead

Ethan
Allin Cottrell
2017-07-06 20:20:36 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
Post by Allin Cottrell
Post by Daniel J Sebald
It isn't the wxgtk library that wants X11, it's gnuplot's use of
XInitThreads() that requires X11. wxgtk configure can't
anticipate our use of an X function. wx_gui shouldn't be using
XInitThreads().
I'd just like to underscore Daniel's last point here. Surely it's a
dangerous hack for the gnuplot code to call XInitThreads() "on
behalf of" wxWidgets (in wxt_gui.h). I suspect this may be related
to the segfault I reported earlier today.
<danger-will-robinson>
#if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) &&
defined(X11)
/* Magic fix needed by wxgtk3.0 */
wxtApp() : wxApp() { XInitThreads(); }
#endif
</danger-will-robinson>
[shrug]
I agree it is stupid that wxgtk does not perform its own initialization.
But it doesn't.
[00] wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)
[01] wxClientDCImpl::DoGetSize(int*, int*) const
[02] wxBufferedDC::UnMask()
[03] ~wxDC /usr/include/wx-3.0/wx/dc.h:789
[04] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[05] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[06] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[07] wxEvtHandler::TryHereOnly(wxEvent&)
[08] wxEvtHandler::ProcessEventLocally(wxEvent&)
[09] wxEvtHandler::ProcessEvent(wxEvent&)
[10] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[11] 0x7f22e8025ee1
[12] g_closure_invoke
[13] 0x7f22e6af0aad
[14] g_signal_emit_valist
[15] g_signal_emit
[16] gtk_widget_size_allocate
[17] 0x7f22e8024ff3
[18] g_closure_invoke
[19] 0x7f22e6af02c7
[20] g_signal_emit_valist
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
1) Link against wxgtk 2.8 rather than anything newer.
These problems only began after libgtk was substantially revised
in version 2.9
2) Try ./configure --with-wx-single-threaded
This never did much for me, but other people have reported better luck
3) Give up on the wxt terminal and use qt instead
Fair enough. I'll try building against wxgtk 2.8.

Allin Cottrell
Allin Cottrell
2017-07-06 21:10:44 UTC
Permalink
Post by Ethan A Merritt via gnuplot-beta
I agree it is stupid that wxgtk does not perform its own initialization.
But it doesn't.
Granted. However, the problem I've encountered lately is at the
other end, wxt_atexit(), and specifically the call

thread->Wait()

in wxt_gui.cpp. This (but just sometimes, so maybe a race
condition?) provokes in wxgtk 3 an assertion failure:

"./src/unix/threadpsx.cpp(1480): assert "This() != this" failed in
Wait(): a thread can't wait for itself"

Is there perhaps a way to guard against that? I'm blissfully
ignorant of C++ "this" shenanigans, but maybe something vaguely
resembling

if (thread != this) // or This() ??
thread->Wait();

Allin Cottrell
Loading...