[R] Spare some CPU cycles for testing lme?

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Sep 14 14:09:55 CEST 2004


As others have said, this needs tools not CPU cycles: gctorture or valgrind.

Valgrind found (after a few seconds and on the first pass)

==23057== Invalid read of size 4
==23057==    at 0x3CF4E645: ssc_symbolic_permute (Mutils.c:373)
==23057==    by 0x3CF5BF75: ssclme_create (ssclme.c:168)
==23057==    by 0x80AF5E8: do_dotcall
(/users/ripley/R/svn/R-devel/src/main/dotcode.c:640)
==23057==    by 0x80CFA84: Rf_eval
(/users/ripley/R/svn/R-devel/src/main/eval.c:399)
==23057==  Address 0x3C7F3BD0 is 4 bytes before a block of size 524 alloc'd
==23057==    at 0x3C01CB56: calloc (in
/opt/local/lib/valgrind/vgpreload_memcheck.so)
==23057==    by 0x80F9EBE: R_chk_calloc
(/users/ripley/R/svn/R-devel/src/main/memory.c:2151)
==23057==    by 0x3CF4E515: ssc_symbolic_permute (Mutils.c:352)
==23057==    by 0x3CF5BF75: ssclme_create (ssclme.c:168)
==23057==
==23057== Use of uninitialised value of size 8
==23057==    at 0x80C0137: Rf_duplicate
(/users/ripley/R/svn/R-devel/src/main/duplicate.c:160)
==23057==    by 0x80BFA85: Rf_duplicate
(/users/ripley/R/svn/R-devel/src/main/duplicate.c:101)
==23057==    by 0x80BFEB3: Rf_duplicate
(/users/ripley/R/svn/R-devel/src/main/duplicate.c:154)
==23057==    by 0x816ED96: do_subset2_dflt
(/users/ripley/R/svn/R-devel/src/main/subset.c:816)
==23057==
==23057== Conditional jump or move depends on uninitialised value(s)
==23057==    at 0x3CF62229: ssclme_fitted (ssclme.c:1587)
==23057==    by 0x80AF646: do_dotcall
(/users/ripley/R/svn/R-devel/src/main/dotcode.c:646)
==23057==    by 0x80CFA84: Rf_eval
(/users/ripley/R/svn/R-devel/src/main/eval.c:399)
==23057==    by 0x80D1D80: do_set
(/users/ripley/R/svn/R-devel/src/main/eval.c:1280)

which is pretty definitive evidence of a problem (possibly 2) in the code.

I strongly recommend valgrind (http://valgrind.kde.org/) if you are using
x86 Linux.  It has found quite a few errors in R and in certain packages
recently.  The only thing to watch is that optimized BLASes will probably
crash it.


On Mon, 13 Sep 2004, Frank Samuelson wrote:

> If anyone has a few extra CPU cycles to spare,
> I'd appreciate it if you could verify a problem that I
> have encountered.  Run the code
> below and tell me if it crashes your R before
> completion.
>
> library(lme4)
> data(bdf)
> dump<-sapply( 1:50000, function(i) {
>      fm <- lme(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen, data = bdf,
>                random = ~ IQ.ver.cen | schoolNR);
>      cat("  ",i,"\r")
>      0
> })
>
> The above code simply reruns the example from the
> lme help page a large number of times and returns a bunch
> of 0's, so you'll need to have the lme4 and Matrix
> packages installed.  It might take a while to complete,
> but you can always nice it and let it run.
>
> I'm attempting to bootstrap lme() from the lme4 package,
> but it causes a
> segfault after a couple hundred iterations.  This happens on
> my Linux x86 RedHat 7.3, 8.0, 9.0, FC1 systems w/ 1.9.1
> and devel 2.0.0 (not all possible combinations actually
> tested.)
> I've communicated w/ Douglas Bates about this and he
> doesn't appear to have the problem.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list