-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mingw32: exception handling broken (breaks ccache etc) #9771
Comments
Sounds familiar. #9289 |
the last gcc/gcc-libs rebuild triggered this... somehow... |
Restoring |
so need to see build log difference whats going on to bisect issue |
the logs of the old build are older than 90 days and have expired sadly |
I will try rebuild locally. Im never use ccache as it lead to errors time to time |
I tried rebuilding gcc locally, it didn't help. |
c++ exception handling is broken in general... the simplest examples fail to catch. Restoring the old #include <iostream>
int main () {
try {
throw "OK";
} catch (const char* msg) {
std::cerr << msg << std::endl;
}
return 0;
} |
ccache
fails on i686
here is a (broken) libstdc++-6 with symbols libstdc++-6.zip since gdb is broken by this too, one needs to use msys gdb:
This goes through a bunch of dwarf2 exception handling code, but I don't know how to debug this, maybe someone else does
|
related upstream discussion: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486 |
so it now also affects the older build Oo omg... |
This is deja vu all over again. Read #4728 (comment) and subsequent comments. Then notice msys2/MSYS2-packages@990d969#diff-73207f91bc9ff822e2e6fc6cf400758228873068eb53db6dff69c8c6c5a181a9 Maybe it is worth a shot. |
omg, is that the fallout of the issue with grep? 🤯 |
the timeline matches. thanks @oscarfv |
After reverting grep to 3.0-2 and building i686 gcc 11.2 (without Ada), C++ exceptions seem to work fine again. |
@oscarfv good catch, I'm not update grep because upstream remove support for handling Windows line endings. This is discussed in Msys-packages times ago. I think we need add some message about this into grep PKGBUILD. |
For history look: |
urgh what a goosechase :S this turned out to be, good catch with the grep issue. |
well one good thing or rather a bad one depending on how you look at it is that we can now do a bootstrap of gcc-11.1 but as before only using an sjlj compiler if you need ada support, exceptions should work in that build. but it might be prudent to wait on the results of the upstream bug report instead. |
For completeness I tried to figure out why this is failing, but there are too many layers and build magic, so I give up:
is enough to fix it with the grep revert Diff of the configure output: --- broken.txt 2021-10-17 19:15:31.582312000 +0200
+++ ok.txt 2021-10-17 19:10:29.938561300 +0200
@@ -1058,7 +1057,7 @@
libtool: compile: /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32 -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include -I/home/user/M/mingw-w64-gcc/src/gcc-10.3.0/libstdc++-v3/libsupc++ -I/mingw32/include -I/mingw32/include -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility-condvar.lo -g -march=pentium4 -mtune=generic -O2 -pipe -std=gnu++11 -c ../../../../gcc-10.3.0/libstdc++-v3/src/c++11/compatibility-condvar.cc -DDLL_EXPORT -DPIC -D_GLIBCXX_SHARED -o .libs/compatibility-condvar.o
libtool: compile: /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32 -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include -I/home/user/M/mingw-w64-gcc/src/gcc-10.3.0/libstdc++-v3/libsupc++ -I/mingw32/include -I/mingw32/include -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility-condvar.lo -g -march=pentium4 -mtune=generic -O2 -pipe -std=gnu++11 -c ../../../../gcc-10.3.0/libstdc++-v3/src/c++11/compatibility-condvar.cc -o compatibility-condvar.o >/dev/null 2>&1
/bin/sh ../libtool --tag CXX --mode=link /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -Wl,-O1 -no-undefined -bindir "/mingw32/bin" -Wl,--gc-sections -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=libstdc++.la '-pipe' '-Wl,--dynamicbase,--nxcompat,--no-seh' '-Wl,--large-address-aware' -o libstdc++.la -version-info 6:28:0 -lm -rpath /mingw32/lib/../lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo compatibility-condvar.lo ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la ../src/c++17/libc++17convenience.la
-libtool: link: /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -shared -nostdlib C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a -Wl,--no-whole-archive -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -Wl,-O1 -Wl,--gc-sections -Wl,--dynamicbase -Wl,--nxcompat -Wl,--no-seh -Wl,--large-address-aware -o .libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libstdc++.dll.a
+libtool: link: /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -shared -nostdlib C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a -Wl,--no-whole-archive -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o -Wl,-O1 -Wl,--gc-sections -Wl,--dynamicbase -Wl,--nxcompat -Wl,--no-seh -Wl,--large-address-aware -o .libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libstdc++.dll.a
libtool: link: (cd .libs/libstdc++.lax/libsupc++convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../libsupc++/.libs/libsupc++convenience.a")
libtool: link: (cd .libs/libstdc++.lax/libc++98convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../src/c++98/.libs/libc++98convenience.a")
libtool: link: (cd .libs/libstdc++.lax/libc++11convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../src/c++11/.libs/libc++11convenience.a") Diff of the build dir (with some noise removed): diff -Nur libstdc++-v3-broken/config.status libstdc++-v3/config.status
--- libstdc++-v3-broken/config.status 2021-10-17 18:44:48.811354600 +0200
+++ libstdc++-v3/config.status 2021-10-17 18:47:45.225970400 +0200
@@ -755,7 +755,7 @@
hardcode_action_CXX='immediate'
compiler_lib_search_dirs_CXX='C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs C:/msys64/mingw32/i686-w64-mingw32/lib C:/msys64/mingw32/lib C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc C:/msys64/mingw32/i686-w64-mingw32/bin C:/msys64/mingw32/i686-w64-mingw32/lib C:/msys64/mingw32/i686-w64-mingw32/lib/../lib C:/msys64/mingw32/i686-w64-mingw32/lib'
predep_objects_CXX='C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o'
-postdep_objects_CXX=''
+postdep_objects_CXX='C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o'
predeps_CXX=''
postdeps_CXX=' -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 '
compiler_lib_search_path_CXX='-LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -LC:/msys64/mingw32/i686-w64-mingw32/lib'
diff -Nur libstdc++-v3-broken/libtool libstdc++-v3/libtool
--- libstdc++-v3-broken/libtool 2021-10-17 18:45:08.664364200 +0200
+++ libstdc++-v3/libtool 2021-10-17 18:48:05.241661100 +0200
@@ -9304,7 +9304,7 @@
# Dependencies to place before and after the objects being linked to
# create a shared library.
predep_objects="C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o"
-postdep_objects=""
+postdep_objects="C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o"
predeps=""
postdeps=" -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 " |
well it seems to be still looked at @https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486 so maybe a real fix will eventually crop up :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Oops, commented on wrong issue |
There is a reference to dwarf exception in libstdc++ x86_64 IIRC |
new build uploaded |
The issue seems fixed as far as we can see (some building which failed yesterday now works). But since I see it is still opened, I wanted to ask and make sure you consider it's really good to go now, or if we should wait a bit. Because we were planning a release yesterday which we postponed because of this issue. Yet if there are still issues to figure out, we don't mind waiting a bit more (a bit late is better than discovering bad surprises at runtime for a release build). |
Releasing GIMP? |
Yes. A dev release (nonetheless a release with official announcement). And we use MSYS2 for base packages on Windows to not have to rebuild everything. 🙂 |
yes, things should be back to "normal" now |
M-AB-S with MinGW32 and ccache enabled works. |
This is quickly closed imo, downgrading to grep 3.0 should be considered a temporary solution grep is my most used tool whether I'm on Windows or Linux. I'm not affected by this issue and I find this is a pity to downgrade grep just because a part of users can't get things working as before. It just lacks a patch and issue should be reopened |
You can still use
By part of users you mean developers of GCC or autotools?
Sure you can open issue in MSYS2-packages repo, even better if you can provide patch to fix it. |
still some problems with exceptions when linking to static libgcc / libstdc++, catches only first exception then aborts. |
i may have a possible fix, it was intended for AIX which suffers the same problem (only happens with dwarf exceptions sjlj is unaffected) but let me test it first before i post a patch. the fix is not OS related so should also work for us, im building gcc-12.2.0 with it atm so lets see. |
sadly not enough with the patch, every program linked statically has broken exceptions :/ for a good laugh try building ninja with gcc-12.2.0 with these flags -static -static-libgcc -static-libstdc++ it will terminate allmost instantly with no error message. this is the 32 bit compiler with dwarf exceptions btw, as mentioned the SEH based 64 bit compiler has no such problem and neither does the 32 bit sjlj exception model. im ditching any gcc above version 10 untill this is fixed upstream in my personal build. |
ccache
doesn't work with MINGW32/MSYS2.Steps to reproduce on the 32-bit bash:
Expected result:
The statistics for ccache should be displayed.
Actual result:
This was still working on CI builds running on Oct 12 8:50 CEDT.
First affected CI build is from Oct 13 4:30 CEDT.
The text was updated successfully, but these errors were encountered: