[R] R crashes when loading rgl package before minqa package

Gaspard Lequeux Gaspard.Lequeux at biomath.ugent.be
Wed Sep 29 17:39:25 CEST 2010


Hej,

Calling newuoa (from the minqa package) makes R crash when the package rgl 
is loaded first. This however only on certain selected data.

The data used for testing (saved to 'bugs.R'):


xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,16,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)

yvals = c(857.7597,975.8624,978.2655,979.3034,965.5919,983.8946,992.2512,992.1178,979.5379,974.4269,968.4113,991.5210,977.3361,985.7800,975.5220,974.6880,973.8102,980.7295,982.0034,984.7993,978.4948,970.4351,969.0718,983.7892,976.3637,980.7833,987.1665,976.6000,975.1332,971.0757,989.4693)

initpar = c(-5.1471384, -3861.8905839, 979.2616002, 0.2572355, 27.5705764)

optimft <- function(x) {
   yft = x[2] + (x[3] - x[2])/((1 + exp(x[1] * (log(xvals) - log(x[4]))))^x[5])
   return(sum((yvals - yft)^2))
}


Sequence of commands needed to make the bug appear:

<Start R>
source('bugs.R')
library(minqa)
library(rgl)
newuoa(initpar, optimft)
  => OK

<Start R>
source('bugs.R')
library(rgl)
library(minqa)
newuoa(initpar, optimft)
   => Crash: segfault: address 0x18, cause 'memory not mapped'

I found the bug using the package qpcR, where rgl is loaded when loading 
qpcR while minqa is only loaded later, when needed.


Running on Debian squeeze 64 bit.
R version: R version 2.11.1 (2010-05-31) x86_64-pc-linux-gnu
rgl version: 0.91
minqa version:  1.1.9
Rcpp version: 0.8.6 (loaded by minqa)

Kind regards,

Gaspard Lequeux



More information about the R-help mailing list