[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: ABI mismatch erorr on wxt terminal on the current msys2-windows build (GCC 12) and workaound
From:       Ethan A Merritt <merritt () uw ! edu>
Date:       2022-05-26 17:23:51
Message-ID: 4426573.cEBGB3zze1 () stonelion
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wednesday, 25 May 2022 22:03:57 PDT Tatsuro MATSUOKA wrote:
> I updated msys2-mingw64 recently and GCC is upgraded to version 12.
> I tried to build gnuplot for windows using  GCC 12 and tried to use the wxt \
> terminal. gnuplot> set terminal wxt
> gnuplot> pl x
> 
> Error windows poped up.
> URL of  the Screenshot http://tmacchant33.starfree.jp/Files/wxt_ABI_mismatch.png
> 
> Fatal Error
> Mismatch between the program and library build version 
> detected.
> The library used 3.0(wchar_t,complier with C++ ABI 1016, wx
> containers, compatible with 2.8),
> and your program used 3.0 (wchr_t,compiler with C++ ABI
> 1017, wx containers, compatible with 2.8).

That is an unfortunate bug/mis-design introduced by the some runtime library support.
I do not know whether something in gcc 12 is the cause, or whether the change from
gcc 11 to gcc 12 coincidentally happened at the same time. 

I now get similar error messages when running programs compiled before the change
For example:
  [] gnuplot_5.2.8 -e 'plot x' 
  Warning: Mismatch between the program and library build versions detected. 
  The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1014,wx \
containers,compatible with 2.6),   and your program used 2.8 (no \
debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).  [] \
gnuplot_5.4.2 -e 'plot x'      Warning: Mismatch between the program and library \
build versions detected.   The library used 3.0 (wchar_t,compiler with C++ ABI \
1014,wx containers,compatible with 2.8),   and wxNet used 3.0 (wchar_t,compiler with \
C++ ABI 1013,wx containers,compatible with 2.8). These executables were built in 2019 \
and 2021.  The C compiler used at the time would not have been gcc 12. The programs \
executed correctly when they were built and continue to execute correctly now.
But now they emit this annoying warning message.


> Workaround is to insert " #define __GXX_ABI_VERSION 1016" 
> at the top of src/wxt_gui.cpp
> --- a/src/wxterminal/wxt_gui.cpp	2022-05-26 12:37:23.464908700 +0900
> +++ b/src/wxterminal/wxt_gui.cpp	2022-05-26 13:10:10.970037600 +0900
> @@ -88,6 +88,8 @@
> * or multi-threaded operation.
> */
> 
> +/* avoid mismatch message C++ ABI number*/
> +#define __GXX_ABI_VERSION 1016

I don't think that is a good idea.

That work-around is likely to work only on a machine that happens to use
that specific version of the runtime library.
As soon as you run the executable on a machine with a newer or older runtime
then it will probably complain about a mismatch between 1016 and some other
version number.   I'm pretty sure it is the warning message that is bogus,
not the program.

Having said that, however, your report claims a fatal error.  My machines
are only printing this as a warning.  Perhaps the mismatch between versions
1016 and 1017 really is more serious?   But then hiding it by lying about the
true version would not fix it. The program may crash later on when it hits the
incompatible ABI feature, whatever that is.

I found some reports on the web that suggest the true problem is an improper
configuration flag used to build the wxgtk library.  However that doesn't make
sense to me, since the error message has only started to appear recently
even though both the wxgtk library and the executable that links to it are
several years old.  I suspect rather that the linker/loader has become overly
paranoid about comparing compiler versions reported by libraries and programs.
I do not know how to fix that.

	Ethan


[Attachment #5 (unknown)]

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">On \
Wednesday, 25 May 2022 22:03:57 PDT Tatsuro MATSUOKA wrote:</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; I updated \
msys2-mingw64 recently and GCC is upgraded to version 12.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; I tried to \
build gnuplot for windows using&nbsp; GCC 12 and tried to use the wxt terminal.</p> \
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
gnuplot&gt; set terminal wxt</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; gnuplot&gt; \
pl x</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; Error \
windows poped up.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; URL of&nbsp; \
the Screenshot http://tmacchant33.starfree.jp/Files/wxt_ABI_mismatch.png</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; </p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; Fatal \
Error</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
Mismatch between the program and library build version </p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; detected.</p> \
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; The \
library used 3.0(wchar_t,complier with C++ ABI 1016, wx</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; containers, \
compatible with 2.8),</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; and your \
program used 3.0 (wchr_t,compiler with C++ ABI</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; 1017, wx \
containers, compatible with 2.8).</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">That is an \
unfortunate bug/mis-design introduced by the some runtime library support.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I do not know \
whether something in gcc 12 is the cause, or whether the change from</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">gcc 11 to gcc 12 \
coincidentally happened at the same time. </p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I now get similar \
error messages when running programs compiled before the change</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">For example:</p> \
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><span \
style="font-family:monospace;"><span style="background-color:#ffffff;"><span \
style="color:#000000;">&nbsp; [] gnuplot_5.2.8 -e 'plot x' </span></span><br />&nbsp; \
Warning: Mismatch between the program and library build versions detected. <br \
/>&nbsp; The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1014,wx \
containers,compatible with 2.6), <br />&nbsp; and your program used 2.8 (no \
debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&nbsp; [] \
gnuplot_5.4.2 -e 'plot x'       <br />&nbsp; Warning: Mismatch between the program \
and library build versions detected. <br />&nbsp; The library used 3.0 \
(wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8), <br />&nbsp; \
and wxNet used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with \
2.8).</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">These \
executables were built in 2019 and 2021.&nbsp; The C compiler used at the</span></p> \
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">time would not \
have been gcc 12. The programs executed correctly when they were</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">built and continue \
to execute correctly now.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">But now they emit \
this annoying warning message.</p> <p>&nbsp;<p>&nbsp;&gt; Workaround is to insert \
&quot; #define __GXX_ABI_VERSION 1016&quot; </p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; at the top of \
src/wxt_gui.cpp</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; --- \
a/src/wxterminal/wxt_gui.cpp&nbsp;&nbsp;&nbsp; 2022-05-26 12:37:23.464908700 \
+0900</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
+++ b/src/wxterminal/wxt_gui.cpp&nbsp;&nbsp;&nbsp; 2022-05-26 13:10:10.970037600 \
+0900</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
@@ -88,6 +88,8 @@</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt;&nbsp;&nbsp; * \
or multi-threaded operation.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt;&nbsp;&nbsp; \
*/</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt;&nbsp; \
</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; +/* \
avoid mismatch message C++ ABI number*/</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; +#define \
__GXX_ABI_VERSION 1016</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I don't think that \
is a good idea.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">That work-around \
is likely to work only on a machine that happens to use</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">that specific \
version of the runtime library.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">As soon as you run \
the executable on a machine with a newer or older runtime</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">then it will \
probably complain about a mismatch between 1016 and some other</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">version \
number.&nbsp;&nbsp; I'm pretty sure it is the warning message that is bogus,</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">not the \
program.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Having said that, \
however, your report claims a fatal error.&nbsp; My machines</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">are only printing \
this as a warning.&nbsp; Perhaps the mismatch between versions</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">1016 and 1017 \
really is more serious?&nbsp;&nbsp; But then hiding it by lying about the</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">true version would \
not fix it. The program may crash later on when it hits the</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">incompatible ABI \
feature, whatever that is.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I found some \
reports on the web that suggest the true problem is an improper</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">configuration flag \
used to build the wxgtk library.&nbsp; However that doesn't make</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">sense to me, since \
the error message has only started to appear recently</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">even though both \
the wxgtk library and the executable that links to it are</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">several years \
old.&nbsp; I suspect rather that the linker/loader has become overly</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">paranoid about \
comparing compiler versions reported by libraries and programs.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I do not know how \
to fix that.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&nbsp;&nbsp;&nbsp; \
Ethan</p> </body>
</html>





_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic