From pgilbert@bank-banque-canada.ca  Wed Nov  7 18:51:33 2001
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Date: Wed, 07 Nov 2001 13:51:33 -0500
Subject: [Rd] segmentation fault with GCC 3.0.2
Message-ID: <3BE982B4.5043FEDB@bank-banque-canada.ca>

I have now tested R 1.3.1 compiled with GCC 3.0.2 on Solaris and the example I
previously posted (repeated below) still gives a segmentation fault, as it does
with GCC 3.0.1 but not with 2.95.2. The eigen calculation sometimes needs to be
repeated several times before the segmentation fault occurs. La.eigen does not
cause a problem. (The problem occurred with R-devel too, but I have not tested
that with GCC 3.0.2.)

One potential problem is that when I configure or make R there are some
inappropriate libraries being picked up. I am not certain where to look or what
to look for, but further below I have copied my guess of the appropriate parts
from configure and make outputs. The only warning is about clock skew (the time
on the file server is not very well synchronized with my machine), but I have
never known this to cause a serious problem.

Any help would be appreciated.

Thanks,
Paul
_____
zz <- t(matrix(c(
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.082008166, -0.066322053,
-0.115616348,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.038919428,  0.009703382,
0.115944209,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.007823026, -0.068859673,
0.025264756,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.067027108,  0.087934957,
-0.316974768,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.024890008,  0.052195412,
-0.015138322,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.028192857, -0.004832597,
0.207879665,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.078706928, -0.012801413,
0.425960682,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0.102169750,  0.163238356,
-0.150373125,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.002685166,  0.014355904,
0.197912183,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  0.042937314,  0.115719388,
0.679370293,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,  0.032306141,  0.263227910,
0.009171148,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,  0.008238734, -0.031480706,
0.051976566,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,  0.015219148,  0.221345314,
0.020146770,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,  0.039741608,  0.092955553,
-0.262550823,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,  0.012624418,  0.047810873,
0.201673308,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -0.114163303,  0.417786916,
0.253110874,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,  0.049894329, -0.155696562,
-0.049735728,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0.006112607,  0.074242237,
0.034046467
), 18,18))

eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
eigen(zz)$values
Segmentation Fault - core dumped

_______
my guess at important parts from ./config output:

checking host system type... sparc-sun-solaris2.6
...
checking build system type... sparc-sun-solaris2.6
checking for ld used by GCC... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for /usr/ccs/bin/ld option to reload object files... -r
...
checking dynamic linker characteristics... solaris2.6 ld.so
checking if libtool supports shared libraries... yes
...
checking for g77... g77
checking whether the Fortran 77 compiler (g77  ) works... yes
checking whether the Fortran 77 compiler (g77  ) is a cross-compiler... no
checking whether we are using GNU Fortran 77... yes
checking whether g77 accepts -g... yes
checking for Fortran 77 libraries...  -lg2c -lm  -L/usr/ccs/lib -L/usr/lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib/sparc-sun-solaris2.6/3.0.2
-L/usr/ccs/bin -L/usr/ccs/lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib/sparc-sun-solaris2.6/3.0.2/../../..
-lm
checking whether g77 appends underscores... yes
checking whether g77 and gcc agree on int and double... yes
checking whether g77 and gcc agree on double complex... yes
checking whether g77 supports -c -o FILE.lo... yes
checking for c++... c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... yes
checking whether we are using GNU C++... yes
checking whether c++ accepts -g... yes
checking how to run the C++ preprocessor... c++ -E
...
checking for GNU C library with version >= 2... no
...
R is now configured for sparc-sun-solaris2.6

  Source directory:          .
  Installation directory:    /usr/local
  C compiler:                gcc  -g -O2
  C++ compiler:              c++  -g -O2
  FORTRAN compiler:          g77  -g -O2

  X11 support:               yes
  Gnome support:             no
  Tcl/Tk support:            no

  R profiling support:       yes
  R as a shared library:     no
_____
my guess at important parts from the make:
...
make[3]: Entering directory `/home/mfa5/gilp/R/R-1.3.1.gnu3.0.2/src/appl'
gcc -I. -I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H   -g -O2 -c approx.c -o approx.o
...
g77   -g -O2 -c eigen.f -o eigen.o
g77   -g -O2 -c lminfl.f -o lminfl.o
g77   -g -O2 -c blas.f -o blas.o
ar cr libappl.a approx.o bakslv.o binning.o chull.o cpoly.o cumsum.o fft.o
fmin.o integrate.o lbfgsb.o loglin.o lowess.o machar.o maxcol.o massdist.o
pretty.o rowsum.o splines.o stem.o strsignif.o tabulate.o uncmin.o zeroin.o
ch2inv.o chol.o dpbfa.o dpbsl.o dpoco.o dpodi.o dpofa.o dposl.o dqrdc.o dqrdc2.o
dqrls.o dqrsl.o dqrutl.o dsvdc.o dtrco.o dtrsl.o eigen.o lminfl.o blas.o
ranlib libappl.a
make[3]: Leaving directory `/home/mfa5/gilp/R/R-1.3.1.gnu3.0.2/src/appl'
make[2]: Leaving directory `/home/mfa5/gilp/R/R-1.3.1.gnu3.0.2/src/appl'
...
gcc -I. -I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H   -g -O2 -c vfonts.c -o vfonts.o
g77   -g -O2 -c xxxpr.f -o xxxpr.o
gcc   -o R.bin  CConverters.o Rdynload.o RNG.o apply.o arithmetic.o array.o
attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o
context.o cov.o cum.o dcf.o datetime.o debug.o devPS.o devPicTeX.o deparse.o
deriv.o devices.o dotcode.o dstruct.o duplicate.o envir.o errors.o eval.o
format.o fourier.o gram.o gram-ex.o graphics.o internet.o iosupport.o lapack.o
list.o logic.o main.o match.o memory.o model.o names.o objects.o optim.o
optimize.o options.o par.o paste.o platform.o plot.o plot3d.o plotmath.o print.o
printarray.o printvector.o printutils.o random.o regex.o relop.o saveload.o
scan.o seq.o size.o sort.o source.o split.o subassign.o subscript.o subset.o
summary.o unique.o util.o version.o vfonts.o xxxpr.o ../unix/libunix.a
../appl/libappl.a ../nmath/libnmath.a   -lg2c -lm  -L/usr/ccs/lib -L/usr/lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib/sparc-sun-solaris2.6/3.0.2
-L/usr/ccs/bin -L/usr/ccs/lib
-L/apps/asd/unix/gnu/gcc/3.0.2/install/lib/gcc-lib/sparc-sun-solaris2.6/3.0.2/../../..
-lm  -L/usr/local/lib  -lnsl -lsocket -ldl -ltermcap -lm
make[4]: Entering directory `/home/mfa5/gilp/R/R-1.3.1.gnu3.0.2/src/main'
...
make[4]: warning:  Clock skew detected.  Your build may be incomplete.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] segmentation fault with GCC 3.0.2
Paul Gilbert