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
gcc: error in catching C++ exceptions #162714
Comments
cc @fxcoudert |
I can now add that I tried the same in a virtual macOS machine on my Mac mini M2. I installed it fresh with Parallels Desktop, installed Visual Studio Code on it, and installed gcc through homebrew. The result was the same as I reported before: abort, with the same message. Clang on the virtual machine ran the program fine till the end. Hope this helps. |
If someone has an Intel version of the compiler and could test that, it would be helpful. |
Running on a 2018 MacMini on macOS 13: MacMini1:~ ios-jenkins$ g++-13 ./test.c -o test
MacMini1:~ ios-jenkins$ ./test
Item constructor called
Item destructor called
Something went wrong. Exception thrown : 110 |
The following also occurs and may be related. If I run
Clang gives the expected output:
but gcc aborts with:
|
Hum, so. I can confirm this is something wrong with GCC 13, and not happening with the development version (which will become GCC 14). With latest GCC, your first example gives:
and the second one:
So it's a bug in GCC 13, that has been fixed and will probably be backported in the next release of 13 (13.3.0). I'll try to identify which one exactly, to make sure it's backported. |
Thanks for taking care! |
Please note that with CLT 15.3 the GCC 13 build fails (iains/gcc-13-branch#14). |
This comment has been minimized.
This comment has been minimized.
What's the workaround for this bug for now? I can't install or update a number of things. |
Revert to CLT 15.1. |
Thanks to Iain Sandoe's work, a fix is deployed in the branch at https://github.com/iains/gcc-13-branch/tree/gcc-13-3-darwin-pre-0 It will be in Homebrew's GCC 13.3 whenever that is released. |
Does the fixed gcc also work properly with CLT 15.3? |
You have to be more precise: why respect to what specific issue? |
While I don't know what issue you are getting, based on what you say here your issue is probably not related to this one. The issue suggestions that appear after a failed brew build are not necessarily accurate. This particular bug report does not currently affect the install of any Homebrew package we're aware of. |
Basically I encountered two issues:
I don't know if they are related, probably not, but it is always good to test. From my experience, recent CLTs are a moving target, with each recent version there were various issues, and I always test my builds on multiple versions. For instance now I had to revert to CLT 15.1 for my builds to pass. |
@ilg-ul I can confirm both issues are fixed, with Xcode 15.3 / CLT 15.3, in the latest version of the gcc-13 branch by Iain. |
Thank you @fxcoudert for confirming. Do you plan to update Homebrew GCC 13.2, or wait for 13.3, probably in July? (the xPack releases follow Homebrew releases). |
That worked for me. Thanks! |
Usually will be late April/early May. |
Hi, thank you for sharing this info. Would you mind sharing how we can replace our local version of 13.2.0 with this new version correctly? Actually, I installed open-mpi at my local which relies on GCC. It looks not working when simply uninstalling the GCC. And I failed to reinstall the GCC in homebrew. |
Hi @NiltonVolpato EDIT: Just figured out this page lists all versions of CLT and other tools https://developer.apple.com/download/all/?q=command%20line%20tools |
Yes. To downgrade to CLT 15.1:
|
FYI, just so you know what might be coming: looks like the qt@5 (5.15) build is also broken under Xcode 15.3, for what look like different reasons. Dunno if another qt@5 build will ever be needed. Downgrading Xcode to 15.2 fixed for me; didn't need to downgrade the CLT. Thanks for the instructions on how to downgrade the CLT, @NiltonVolpato! I wasn't able to figure that out myself, and doing so got GCC building for me again. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output" saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I tried to compile and run the following program, from an online course on C++, about throwing and catching exceptions:
The program ran on a Mac mini M2 machine under Visual Studio Code.
What happened (include all command output)?
The program compiled fine under gcc 13.2.0, installed at /opt/homebrew/bin by homebrew. When I ran it, the output was:
What did you expect to happen?
I expected the following output:
This is the correct output, and it was produced when I compiled and ran it under Clang. Also, when I ran the program on the online gcc compiler at https://rextester.com/l/cpp_online_compiler_gcc, it gave the same correct output.
Therefore I suspect there is a problem with the brew-installed version.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: