Bug 35169 - SIGSEGV for stack growth failure while building 4.2.3
Summary: SIGSEGV for stack growth failure while building 4.2.3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.2.3
: P3 normal
Target Milestone: ---
Assignee: Ralf Wildenhues
URL:
Keywords:
: 27794 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-11 20:29 UTC by The Written Word
Modified: 2008-05-02 09:19 UTC (History)
4 users (show)

See Also:
Host: ia64-hp-hpux11.23
Target: ia64-hp-hpux11.23
Build: ia64-hp-hpux11.23
Known to work:
Known to fail:
Last reconfirmed: 2008-03-31 11:32:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description The Written Word 2008-02-11 20:29:20 UTC
I am attempting to build 4.2.3 on HP-UX 11.23/IA.
  $ bzip2 -dc gcc-4.2.3.tar.bz2 | tar xf -
  $ mkdir gcc-4.2.3-objdir
  $ cd gcc-4.2.3-objdir
  $ /opt/build/china/gcc423/ia64-hp-hpux11.23/bin/as -v
  GNU assembler version 2.18 (ia64-hp-hpux11.23) using BFD version (GNU Binutils) 2.18
  $ CC=cc bash /opt/build/china/gcc-4.2.3/configure --with-included-gettext --enable-shared --with-gnu-as --with-as=/opt/build/china/gcc423/ia64-hp-hpux11.23/bin/as --enable-languages="c"
  ...
  $ gmake bootstrap
  ...
/opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc -B/opt/build/china/gcc-4.2.3-objdir/./gcc/ -B/usr/local/ia64-hp-hpux11.23/bin/ -B/usr/local/ia64-hp-hpux11.23/lib/ -isystem /usr/local/ia64-hp-hpux11.23/include -isystem /usr/local/ia64-hp-hpux11.23/sys-include -O2  -O2 -g  -DIN_GCC    -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I -I/opt/build/china/gcc-4.2.3/gcc -I/opt/build/china/gcc-4.2.3/gcc/ -I/opt/build/china/gcc-4.2.3/gcc/../include -I./../intl -I/opt/build/china/gcc-4.2.3/gcc/../libcpp/include  -I/opt/build/china/gcc-4.2.3/gcc/../libdecnumber -I../libdecnumber -DSHARED -c /opt/build/china/gcc-4.2.3/gcc/config/floatunsitf.c -o libgcc/./floatunsitf_s.o
/opt/build/china/gcc-4.2.3/gcc/config/floatunsitf.c:8: warning: no previous prototype for '__floatunsitf'
{ /usr/ccs/bin/nm -pg libgcc/./__divxf3_s.o libgcc/./__divdf3_s.o libgcc/./__divsf3_s.o libgcc/./__divdi3_s.o libgcc/./__moddi3_s.o libgcc/./__udivdi3_s.o libgcc/./__umoddi3_s.o libgcc/./__divsi3_s.o libgcc/./__modsi3_s.o libgcc/./__udivsi3_s.o libgcc/./__umodsi3_s.o libgcc/./__save_stack_nonlocal_s.o libgcc/./__nonlocal_goto_s.o libgcc/./__restore_stack_nonlocal_s.o libgcc/./__trampoline_s.o libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_floatdisf_s.o libgcc/./_floatundisf_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_floatdidf_s.o libgcc/./_floatundidf_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_floatundixf_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_floatunditf_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./quadlib_s.o libgcc/./floatunsitf_s.o; echo %%; \
  cat /opt/build/china/gcc-4.2.3/gcc/config/ia64/libgcc-ia64.ver \
    | sed -e '/^[   ]*#/d' \
          -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
    | /opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc -B/opt/build/china/gcc-4.2.3-objdir/./gcc/ -B/usr/local/ia64-hp-hpux11.23/bin/ -B/usr/local/ia64-hp-hpux11.23/lib/ -isystem /usr/local/ia64-hp-hpux11.23/include -isystem /usr/local/ia64-hp-hpux11.23/sys-include -O2  -O2 -g  -DIN_GCC    -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I -I/opt/build/china/gcc-4.2.3/gcc -I/opt/build/china/gcc-4.2.3/gcc/ -I/opt/build/china/gcc-4.2.3/gcc/../include -I./../intl -I/opt/build/china/gcc-4.2.3/gcc/../libcpp/include  -I/opt/build/china/gcc-4.2.3/gcc/../libdecnumber -I../libdecnumber  -E -xassembler-with-cpp -; \
} | awk -f /opt/build/china/gcc-4.2.3/gcc/mkmap-flat.awk  > libgcc/./tmp-libgcc.map

Pid 18929 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz. 
mv 'libgcc/./tmp-libgcc.map' libgcc/./libgcc.map
/opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc -B/opt/build/china/gcc-4.2.3-objdir/./gcc/ -B/usr/local/ia64-hp-hpux11.23/bin/ -B/usr/local/ia64-hp-hpux11.23/lib/ -isystem /usr/local/ia64-hp-hpux11.23/include -isystem /usr/local/ia64-hp-hpux11.23/sys-include -O2  -O2 -g  -DIN_GCC    -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,+h,libgcc_s.so.0 -o ./libgcc_s.so  libgcc/./__divxf3_s.o libgcc/./__divdf3_s.o libgcc/./__divsf3_s.o libgcc/./__divdi3_s.o libgcc/./__moddi3_s.o libgcc/./__udivdi3_s.o libgcc/./__umoddi3_s.o libgcc/./__divsi3_s.o libgcc/./__modsi3_s.o libgcc/./__udivsi3_s.o libgcc/./__umodsi3_s.o libgcc/./__save_stack_nonlocal_s.o libgcc/./__nonlocal_goto_s.o libgcc/./__restore_stack_nonlocal_s.o libgcc/./__trampoline_s.o libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_floatdisf_s.o libgcc/./_floatundisf_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_floatdidf_s.o libgcc/./_floatundidf_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_floatundixf_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_floatunditf_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./quadlib_s.o libgcc/./floatunsitf_s.o -lunwind -lc && rm -f ./libgcc_s.so.0 && ln -s libgcc_s.so ./libgcc_s.so.0
/opt/build/china
Pid 18942 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz. 
/gcc-4.2.3-objdir/./gcc/xgcc -B/opt/build/china/gcc-4.2.3-objdir/./gcc/ -B/usr/local/ia64-hp-hpux11.23/bin/ -B/usr/local/ia64-hp-hpux11.23/lib/ -isystem /usr/local/ia64-hp-hpux11.23/include -isystem /usr/local/ia64-hp-hpux11.23/sys-include -O2  -O2 -g  -DIN_GCC    -DUSE_LIBUNWIND_EXCEPTIONS -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I -I/opt/build/china/gcc-4.2.3/gcc -I/opt/build/china/gcc-4.2.3/gcc/ -I/opt/build/china/gcc-4.2.3/gcc/../include -I./../intl -I/opt/build/china/gcc-4.2.3/gcc/../libcpp/include  -I/opt/build/china/gcc-4.2.3/gcc/../libdecnumber -I../libdecnumber -DSHARED -mlp64 -DL__divxf3 -xassembler-with-cpp -c /opt/build/china/gcc-4.2.3/gcc/config/ia64/lib1funcs.asm -o libgcc/hpux64/__divxf3_s.o
gmake[4]: *** [libgcc/hpux64/__divxf3_s.o] Segmentation fault (core dumped)
gmake[4]: Leaving directory `/opt/build/china/gcc-4.2.3-objdir/gcc'
gmake[3]: *** [stmp-multilib] Error 2
gmake[3]: Leaving directory `/opt/build/china/gcc-4.2.3-objdir/gcc'
gmake[2]: *** [all-stage1-gcc] Error 2
gmake[2]: Leaving directory `/opt/build/china/gcc-4.2.3-objdir'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/opt/build/china/gcc-4.2.3-objdir'
gmake: *** [bootstrap] Error 2

  $ limit
  cputime         unlimited
  filesize        unlimited
  datasize        1024MB
  stacksize       128MB
  coredumpsize    2047MB
  resident        unlimited
  descriptors     2048
  addressspace    unlimited
  cachedthreads   256
  aiooperations   unlimited
  aiomemorylocked unlimited
  RSESTACK        8388608
Comment 1 Andrew Pinski 2008-02-12 01:36:02 UTC
ld is running at this time so I doubt this is a GCC bug.
Comment 2 The Written Word 2008-02-12 03:52:36 UTC
(In reply to comment #1)
> ld is running at this time so I doubt this is a GCC bug.

The Pid it is referring to ("Pid 18929 received a SIGSEGV for stack growth failure.") is /opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc. I ran the command under tusc (similar to truss(1) on Solaris or strace(1) on Redhat) and there is no call to ld.
Comment 3 The Written Word 2008-03-28 20:58:45 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > ld is running at this time so I doubt this is a GCC bug.
> 
> The Pid it is referring to ("Pid 18929 received a SIGSEGV for stack growth
> failure.") is /opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc.


Seems to be recursing in cancel_option until stack runs out:
Breakpoint 5, cancel_option (opt_idx=30, next_opt_idx=0, orig_next_opt_idx=555)
    at /opt/build/gcc-4.2.3/gcc/opts-common.c:118
118       if (cl_options [next_opt_idx].neg_index == opt_idx)
(gdb) n
121       if (cl_options [next_opt_idx].neg_index != orig_next_opt_idx)
(gdb) 
122         return cancel_option (opt_idx, cl_options [next_opt_idx].neg_index,
(gdb) 

Breakpoint 5, cancel_option (opt_idx=30, next_opt_idx=0, orig_next_opt_idx=555)
    at /opt/build/gcc-4.2.3/gcc/opts-common.c:118
118       if (cl_options [next_opt_idx].neg_index == opt_idx)
(gdb) 
121       if (cl_options [next_opt_idx].neg_index != orig_next_opt_idx)
(gdb) 
122         return cancel_option (opt_idx, cl_options [next_opt_idx].neg_index,
(gdb) 

Breakpoint 5, cancel_option (opt_idx=30, next_opt_idx=0, orig_next_opt_idx=555)
    at /opt/build/gcc-4.2.3/gcc/opts-common.c:118
118       if (cl_options [next_opt_idx].neg_index == opt_idx)
Comment 4 The Written Word 2008-03-29 02:21:25 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > ld is running at this time so I doubt this is a GCC bug.
> > 
> > The Pid it is referring to ("Pid 18929 received a SIGSEGV for stack growth
> > failure.") is /opt/build/china/gcc-4.2.3-objdir/./gcc/xgcc.
> 
> 
> Seems to be recursing in cancel_option until stack runs out:
>

All due to a bug in awk on ia64-hpux11.23. Using gawk allows the build to complete. Here is a selection of a diff from options.c generated with awk and gawk:
   { "-W",
     "This switch is deprecated; use -Wextra instead",
-    N_OPTS, 1, 0,
+    N_OPTS, 1, -1,
     CL_COMMON | CL_REJECT_NEGATIVE,
     0, CLVC_BOOLEAN, 0 },
Comment 5 Ralf Wildenhues 2008-03-31 21:19:44 UTC
patch at <http://gcc.gnu.org/ml/gcc-patches/2008-03/msg02037.html>
Comment 6 littlestar 2008-04-17 15:09:44 UTC
same as PR27794?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27794

confirmed, gcc 4.2.2 hp ia64 11.23

Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
make[4]: *** [libgcc/hpux64/__divxf3.o] Segmentation fault (core dumped)
make[4]: Leaving directory `/os/build/gcc-4.2.2-build/build/gcc'
make[3]: *** [stmp-multilib] Error 2
make[3]: Leaving directory `/os/build/gcc-4.2.2-build/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/os/build/gcc-4.2.2-build/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/os/build/gcc-4.2.2-build/build'
make: *** [all] Error 2
Comment 7 Ralf Wildenhues 2008-04-28 22:28:16 UTC
Subject: Bug 35169

Author: rwild
Date: Mon Apr 28 22:27:22 2008
New Revision: 134768

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134768
Log:
gcc/
	PR bootstrap/35169
	* optc-gen.awk: Work around HP-UX/IA awk bug.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/optc-gen.awk

Comment 8 Ralf Wildenhues 2008-05-02 04:09:03 UTC
Subject: Bug 35169

Author: rwild
Date: Fri May  2 04:08:11 2008
New Revision: 134880

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134880
Log:
gcc/
	PR bootstrap/35169
	* optc-gen.awk: Work around HP-UX/IA awk bug.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/optc-gen.awk

Comment 9 Ralf Wildenhues 2008-05-02 04:16:26 UTC
Subject: Bug 35169

Author: rwild
Date: Fri May  2 04:15:36 2008
New Revision: 134881

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134881
Log:
gcc/
	PR bootstrap/35169
	* optc-gen.awk: Work around HP-UX/IA awk bug.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/optc-gen.awk

Comment 10 Ralf Wildenhues 2008-05-02 04:30:55 UTC
Fixed.
Comment 11 Eric Botcazou 2008-05-02 09:19:48 UTC
*** Bug 27794 has been marked as a duplicate of this bug. ***