Bug 59547 - gcc segfaults when compiling gv-3.5.8 with make -j
Summary: gcc segfaults when compiling gv-3.5.8 with make -j
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL: ftp://ftpthep.physik.uni-mainz.de/pub...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-10 03:58 UTC by Marc Culler
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-02-13 02:16:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Marc Culler 2002-02-10 03:58:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.9-21 i686)

Description of problem:
The gv-3.5.8 source code uses the -j flag to make.  The gcc compiler segfaults
when compiling
gv-3.5.8 "out of the box".  If the -j flag is disabled then the compilation
completes successfully. 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Get the gv-3.5.8 source from ftp://ftpthep.physik.uni-mainz.de/pub/gv and
unpack.
2. Edit the file source/paths.h to remove the ## characters from the INC_X11,
INC_XMU
and INC_XAW macros.
3.  xmkmf; make Makefiles; make
	

Actual Results:  Below is some of the compiler output.  The compilation of
magmenu.c was started several steps earlier.  The "undeclared variable" error in
process_menu does not arise when compiling without the -j flag.  Also, the crash
can occur in different source files on different runs.

I have a 1.8GHz Pentium 4 system running the 2.4.9-21 kernel.  I just installed
Redhat 7.2 today and immediately installed all of the up2date rpms found by the
update agent, including: 
glibc-2.2.4-19.3.i686.rpm
glibc-common-2.2.4-19.3.i386.rpm
glibc-devel-2.2.4-19.3.i386.rpm
kernel-2.4.9-21.i686.rpm
kernel-headers-2.4.9-21.i386.rpm
modutils-2.4.10-1.i386.rpm

I imagine that this might be a race condition and might behave differently on
different architechtures.  And it seems quite likely to me that the bug is
actually in the threads library used by make, not in gcc per se.

>>>>>>>>>>>>>>>>>> OUTPUT FOLLOWS:

gcc -O2 -march=i386 -mcpu=i686 -pipe      -I/usr/X11R6/include   -Dlinux
-D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE
-D_BSD_SOURCE -D_SVID_SOURCE     -DFUNCPROTO=15 -DNARROWPROTO  
-DNON_BLOCKING_IO     -DUSE_SIGNAL_HANDLER    -DUSER_DEFAULTS=\"~/.gv\"
-DGV_LIBDIR=\"/usr/local/lib/gv/\" -DGV_CODE  -DUSE_FALLBACK_STYLES          -c
-o popup.o popup.c
magmenu.c: In function `magmenu_a_magMenu':
magmenu.c:358: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
make[1]: *** [magmenu.o] Error 1
make[1]: *** Waiting for unfinished jobs....
process.c: In function `process_menu':
process.c:365: `processButton' undeclared (first use in this function)
process.c:365: (Each undeclared identifier is reported only once
process.c:365: for each function it appears in.)
process.c:409: `processMenu' undeclared (first use in this function)
make[1]: *** [process.o] Error 1
make: *** [all] Error 2


Expected Results:  Of course this very widely used program should compile
correctly, even with the parallelizing make option enabled.  (I also think that
gv should be included in the RedHat 7.2 distribution in binary form, and I have
no idea why the source is distributed with that broken paths.h.)

Additional info:

Comment 1 Jakub Jelinek 2002-02-12 12:28:43 UTC
Is it reproduceable (you get the same error always on the same file)?
The fact that removing -j from make help suggest that it probably is not.
Also, were you using -j somenumber or just -j without any argument?
The latter might mean you just get ouf of main memory/swap.

Comment 2 Marc Culler 2002-02-13 02:16:39 UTC
It  seems unlikely that I would use up 1GB of memory and 2GB of swap compiling
gv.  The crash occurred every time that I ran make, and I ran it several times. 
On the other hand,  I am no longer able to reproduce the crash.  So it may have
had to do with the state of my system at that time.  I guess you could say that
it was "fixed" by rebooting.  Sigh.


Note You need to log in before you can comment on or make changes to this bug.