From adrian at maths.uwa.edu.au  Thu Dec 17 08:35:09 2009
From: adrian at maths.uwa.edu.au (adrian at maths.uwa.edu.au)
Date: Thu, 17 Dec 2009 08:35:09 +0100 (CET)
Subject: [Rd] segfault in glm.fit (PR#14154)
Message-ID: <20091217073510.19DEB2831FE5@mail.pubhealth.ku.dk>

Bug summary:
             glm() causes a segfault if the argument 'data'
             is a data frame with more than 16384 rows.

Bug demonstration:

-------input ---------------
      N <- 16400
      df <- data.frame(x=runif(N, min=1,max=2),y=rpois(N, 2))
      glm(y ~ x, family=poisson, data=df)

------ output ---------------
      *** caught segfault ***
      address (nil), cause 'unknown'

      Traceback:
 1: ifelse(y == 0, 1, y/mu)
 2: dev.resids(y, mu, weights)
 3: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = 
etastart,     mustart = mustart, offset = offset, family = family, 
control = control,     intercept = attr(mt, "intercept") > 0)
 4: glm(y ~ x, family = poisson, data = df)

--------------------------------

The code generates a segfault if the value of 'N' is greater than 16384.

regards
Adrian Baddeley

////////////////////////////////////////////////////////////

--please do not edit the information below--

Version:
 platform = x86_64-unknown-linux-gnu
 arch = x86_64
 os = linux-gnu
 system = x86_64, linux-gnu
 status =
 major = 2
 minor = 10.1
 year = 2009
 month = 12
 day = 14
 svn rev = 50720
 language = R
 version.string = R version 2.10.1 (2009-12-14)

Locale:
LC_CTYPE=en_AU.UTF-8;LC_NUMERIC=C;LC_TIME=en_AU.UTF-8;LC_COLLATE=en_AU.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_AU.UTF-8;LC_PAPER=en_AU.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_AU.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices, 
package:utils, package:datasets, package:methods, Autoloads, package:base



[Rd] segfault in glm.fit (PR#14154)
adrian at maths.uwa.edu.au