Building libada on Solaris 10/x86 fails when compiling g-catiio.adb: $ ../../xgcc -B../../ -c -g -O2 -fPIC -W -Wall -gnatpg g-catiio.adb -o g-catiio.o xgcc: Internal error: Segmentation Fault (program gnat1)
Running gnat1 under gdb reveals that this happens due to extremely deep recursion in Program received signal SIGSEGV, Segmentation fault. 0x085e88bd in ggc_set_mark (p=0xd13f5bd0) at /vol/gnu/src/gcc/gcc-dist/gcc/ggc-page.c:1254 (gdb) where #0 0x085e88bd in ggc_set_mark (p=0xd13f5bd0) at /vol/gnu/src/gcc/gcc-dist/gcc/ggc-page.c:1254 #1 0x0812b7d1 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5bd0) at gtype-ada.h:27 #2 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5bf4) at gtype-ada.h:178 #3 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5c18) at gtype-ada.h:178 #4 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5c3c) at gtype-ada.h:178 #5 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5c60) at gtype-ada.h:178 #6 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5c84) at gtype-ada.h:178 #7 0x0812b9d2 in gt_ggc_mx_lang_tree_node (x_p=0xd13f5ca8) at gtype-ada.h:178 [...] This went on to a depth of 76000+ when I aborted gnat1. The problem exists with the default stack size of 8430 kB; if I increase the stack size limit to the max (i.e. 130336 kB), the compilation succeeds. While this might be a workaround, I don't consider it a solution. Environment: System: SunOS erebus 5.10 s10_69 i86pc i386 i86pc Architecture: i86pc host: i386-pc-solaris2.10 build: i386-pc-solaris2.10 target: i386-pc-solaris2.10 configured with: /vol/gnu/src/gcc/gcc-dist/configure --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls --enable-languages=c,ada How-To-Repeat: Bootstrap current mainline as above. -- Summary: SEGV (stack overflow) compiling g-catiio.adb on Solaris 10/x86 Product: gcc Version: 0.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ro at techfak dot uni-bielefeld dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-pc-solaris2.10 GCC host triplet: i386-pc-solaris2.10 GCC target triplet: i386-pc-solaris2.10 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18301