[Bug objc++/61759] [ICE] [objc] reaching gcc_unreachable in objc_eh_runtime_type at objc/objc-next-runtime-abi-01.c
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 7 16:23:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61759
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|powerpc-unknown-darwin |*-*-darwin
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-09-07
Host|powerpc-unknown-darwin |*-*-darwin
Ever confirmed|0 |1
Known to fail| |8.0
Build|powerpc-unknown-darwin |*-*-darwin
--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #7)
> (In reply to Douglas Mencken from comment #6)
> > Looks like I found the root of the issue ~
> > GCC ICEs when it meets C++ exception handling (try+catch)
> >
> > $ cat main.mm
> > #include <Foundation/Foundation.h>
> > #include <iostream>
> >
> > int main (void)
> > {
> > try {
> > throw 0;
> > } catch (int & e) {
> > std::cout << "caught" << std::endl;
> > }
> >
> > NSString *name = @"GNUstep !";
> > NSAutoreleasePool *pool;
> > pool = [NSAutoreleasePool new];
> > [pool drain];
> > }
> >
> > $ g++ main.mm -o test.out -framework Foundation -lobjc
> > main.mm: In function 'int main()':
> > main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at
> > objc/objc-next-runtime-abi-01.c:2804
> > int main (void)
> > ^
> > libbacktrace could not find executable to open
> > Please submit a full bug report,
>
> This is similar to bug 35756 but since you have a different testcase I'll
> leave this open as a separate bug. Anyways, I think I have bad headers on my
> system, because my compiler chokes in that part:
>
> $ /usr/local/bin/g++ 61759_main.mm -o test.out -framework Foundation -lobjc
> In file included from
> /System/Library/Frameworks/Security.framework/Headers/Security.h:57:0,
> from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.
> framework/Headers/LSSharedFileList.h:32,
> from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.
> framework/Headers/LaunchServices.h:37,
> from
> /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:41,
> from
> /System/Library/Frameworks/ApplicationServices.framework/Headers/
> ApplicationServices.h:20,
> from
> /System/Library/Frameworks/Foundation.framework/Headers/
> NSAppleEventDescriptor.h:8,
> from
> /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:107,
> from 61759_main.mm:1:
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46:
> error: shift expression ‘(1853123693 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeNTLM = AUTH_TYPE_FIX_ ('ntlm'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46:
> error: enumerator value for ‘kSecAuthenticationTypeNTLM’ is not an integer
> constant
> kSecAuthenticationTypeNTLM = AUTH_TYPE_FIX_ ('ntlm'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46:
> error: shift expression ‘(1836281441 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeMSN = AUTH_TYPE_FIX_ ('msna'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46:
> error: enumerator value for ‘kSecAuthenticationTypeMSN’ is not an integer
> constant
> kSecAuthenticationTypeMSN = AUTH_TYPE_FIX_ ('msna'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46:
> error: shift expression ‘(1685086561 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeDPA = AUTH_TYPE_FIX_ ('dpaa'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46:
> error: enumerator value for ‘kSecAuthenticationTypeDPA’ is not an integer
> constant
> kSecAuthenticationTypeDPA = AUTH_TYPE_FIX_ ('dpaa'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46:
> error: shift expression ‘(1919967585 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeRPA = AUTH_TYPE_FIX_ ('rpaa'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46:
> error: enumerator value for ‘kSecAuthenticationTypeRPA’ is not an integer
> constant
> kSecAuthenticationTypeRPA = AUTH_TYPE_FIX_ ('rpaa'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46:
> error: shift expression ‘(1752462448 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeHTTPBasic = AUTH_TYPE_FIX_ ('http'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTTPBasic’ is not an
> integer constant
> kSecAuthenticationTypeHTTPBasic = AUTH_TYPE_FIX_ ('http'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46:
> error: shift expression ‘(1752462436 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeHTTPDigest = AUTH_TYPE_FIX_ ('httd'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTTPDigest’ is not an
> integer constant
> kSecAuthenticationTypeHTTPDigest = AUTH_TYPE_FIX_ ('httd'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46:
> error: shift expression ‘(1718579821 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeHTMLForm = AUTH_TYPE_FIX_ ('form'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTMLForm’ is not an
> integer constant
> kSecAuthenticationTypeHTMLForm = AUTH_TYPE_FIX_ ('form'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46:
> error: shift expression ‘(1684434036 << 8)’ overflows [-fpermissive]
> kSecAuthenticationTypeDefault = AUTH_TYPE_FIX_ ('dflt'),
> ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46:
> error: enumerator value for ‘kSecAuthenticationTypeDefault’ is not an
> integer constant
> kSecAuthenticationTypeDefault = AUTH_TYPE_FIX_ ('dflt'),
> ^
> In file included from /usr/local/include/c++/8.0.0/bits/ios_base.h:46:0,
> from /usr/local/include/c++/8.0.0/ios:42,
> from /usr/local/include/c++/8.0.0/ostream:38,
> from /usr/local/include/c++/8.0.0/iostream:39,
> from 61759_main.mm:2:
> /usr/local/include/c++/8.0.0/system_error:191:23: internal compiler error:
> Bus error
> explicit operator bool() const noexcept
> ^~~~
> libbacktrace could not find executable to open
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <https://gcc.gnu.org/bugs/> for instructions.
>
> And my ICE looks similar to the one I get in bug 57607 which also includes
> the c++ <iostream> header...
This error has now disappeared for me, so I can now confirm that I'm getting
the same ICE that you originally reported:
$ /usr/local/bin/g++ 61759_main.mm -fpermissive -o 61759.exe -framework
Foundation -lobjc
during GIMPLE pass: eh
61759_main.mm: In function ‘int main()’:
61759_main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at
objc/objc-next-runtime-abi-01.c:2793
int main (void)
^~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
$
Running in gdb gives this backtrace:
Breakpoint 1, 0x00e60154 in internal_error ()
(gdb) bt
#0 0x00e60154 in internal_error ()
#1 0x014954c5 in fancy_abort ()
#2 0x0118edd7 in objc_eh_runtime_type ()
#3 0x0076e69e in add_type_for_runtime ()
#4 0x0076e715 in gen_eh_region_catch ()
#5 0x00ba90de in lower_eh_constructs_1 ()
#6 0x00baa7fb in (anonymous namespace)::pass_lower_eh::execute ()
#7 0x00a5b2e0 in execute_one_pass ()
#8 0x00a5bba0 in execute_pass_list_1 ()
#9 0x00a5bbee in execute_pass_list ()
#10 0x0067ecb9 in cgraph_node::analyze ()
#11 0x006819ef in analyze_functions ()
#12 0x006829d2 in symbol_table::finalize_compilation_unit ()
#13 0x00b4638b in compile_file ()
#14 0x01af141b in toplev::main ()
#15 0x01af2a24 in main ()
(gdb)
I'd need to rebuild gcc with debug info to get a better backtrace.
More information about the Gcc-bugs
mailing list