lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Fwd: How did this unit test fail?


From: Vadim Zeitlin
Subject: Re: [lmi] Fwd: How did this unit test fail?
Date: Thu, 22 Mar 2018 16:18:09 +0100

On Wed, 21 Mar 2018 13:31:14 +0000 Greg Chicares <address@hidden> wrote:

GC> I'm wondering the problem could be that debian's MinGW-w64 package
GC> is missing some upstream fix. I'm using the latest:
GC> 
GC> # apt-get -s install g++-mingw-w64
GC> Reading package lists... Done
GC> Building dependency tree       
GC> Reading state information... Done
GC> g++-mingw-w64 is already the newest version (7.2.0-20+20.2).

 I have some interesting news: using exactly the same compiler in my Buster
chroot, I can indeed reproduce the problem, i.e. I see exactly the same
failure as you do. However for me it happens with the unmodified master
(a86806ca422d6a40cc5f0424932367ee3aa74cd5) sources, i.e. without reverting
the changes of 3d3e2b67916c72c7446f140f2f986456b1164b1e. Moreover, if I do
revert them, then the problem goes away. I.e. I see exactly the converse of
what you see which is really, really weird.

 Part of the explanation is that we use different build systems and so
(slightly) different compiler flags because copying and pasting the
commands below:

GC> /opt/lmi/src/lmi[0]$make bourn_cast_test.exe
GC> i686-w64-mingw32-g++ -MMD -MP -MT alert.o -MF alert.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/alert.cpp -oalert.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT alert_cli.o -MF alert_cli.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/alert_cli.cpp -oalert_cli.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT fenv_lmi.o -MF fenv_lmi.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/fenv_lmi.cpp -ofenv_lmi.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT getopt.o -MF getopt.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/getopt.cpp -ogetopt.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT license.o -MF license.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/license.cpp -olicense.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT bourn_cast_test.o -MF bourn_cast_test.d  
-c -I /opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/bourn_cast_test.cpp 
-obourn_cast_test.o
GC> i686-w64-mingw32-g++ -MMD -MP -MT timer.o -MF timer.d  -c -I 
/opt/lmi/src/lmi -I /opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_NO_AUTO_PTR 
-DBOOST_STRICT_CONFIG -DBOOST_STATIC_ASSERT_HPP   -std=c++17 -frounding-math 
-pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef 
-Wunreachable-code -Wwrite-strings  -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-conversion -Wno-parentheses   
-D'BOOST_STATIC_ASSERT(A)=static_assert((A))'   -ggdb -O2 
-fno-omit-frame-pointer    /opt/lmi/src/lmi/timer.cpp -otimer.o
GC> i686-w64-mingw32-g++ -o bourn_cast_test.exe alert.o alert_cli.o fenv_lmi.o 
getopt.o license.o bourn_cast_test.o timer.o -L . -L /opt/lmi/local/lib -L 
/opt/lmi/local/bin    -lexslt -lxslt -lxml2      
-Wl,-Map,bourn_cast_test.exe.map 

I can indeed reproduce exactly the same results as you see, i.e. the test
passes with unmodified master and fails after partially reverting
3d3e2b67916c72c7446f140f2f986456b1164b1e (let me call this "old version"
below to avoid repeating this long revision again).

 As an aside, I am still not sure what do I need to do use the official
makefiles under Linux because if I just do "make bourn_cast_test.exe", I
get plenty of errors, e.g. about missing g++ etc. Is there a script similar
to install_msw.sh for Linux that I could follow, by chance?


 Anyhow, returning to the different compiler options, there is definitely
something crazy going on here because I've determined that removing "-Wall"
from bourn_cast_test.cpp compilation line is enough to make the test pass,
both with the latest and the old version of the file. So not only "-Wall"
somehow changes the generated code, which it's definitely not supposed to
do at all, but it does it for the manual makefile and not (or at least not
in the same manner) as for the autotools one, which also uses "-Wall", of
course.

 Right now I don't understand at all what's going on here, I'm going to try
to minimize the test case and open a gcc bug report if I manage to do it
because it clearly looks like something is very, very wrong with it. But I
already wanted to tell you about my findings so far, just so that you don't
waste as much time as I already did on the same thing.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]