bhx5 at mevik.net
2006-Sep-12 14:35 UTC
[Rd] segfault in plot(x, y, col = aFactor) (PR#9221)
After the following commands (issued just after starting R) set.seed(1) n <- 600 x <- rnorm(n) y <- rnorm(n) aFactor <- factor(rep(1:5, length = n)) plot(x, y, col = aFactor) R prints *** caught segfault *** address 0x10, cause 'memory not mapped' Segmentation fault and dies. (Yes, I know that using a factor as `col' is wrong; I discovered this by a mistake. :-) Substituting "aFactor <- factor(rep(1:5, length = n))" with "aFactor <- rep(1:5, length = n)" (obviously) works as expected. When n is smaller, for instance 400, no seg.fault seems to happen. I also tested this on R 2.3.1 (that's actually where I discovered it :-), and the same thing happens there. --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 = alpha major = 2 minor = 4.0 year = 2006 month = 09 day = 11 svn rev = 39258 language = R version.string = R version 2.4.0 alpha (2006-09-11 r39258) Locale: LC_CTYPE=no_NO.UTF-8;LC_NUMERIC=C;LC_TIME=no_NO.UTF-8;LC_COLLATE=no_NO.UTF-8;LC_MONETARY=no_NO.UTF-8;LC_MESSAGES=no_NO.UTF-8;LC_PAPER=no_NO.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=no_NO.UTF-8;LC_IDENTIFICATION=C Search Path: .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base -- Bj?rn-Helge Mevik
maechler at stat.math.ethz.ch
2006-Sep-12 15:18 UTC
[Rd] segfault in plot(x, y, col = aFactor) (PR#9221)
Thank you, Bj?rn-Helge. A shorter version is plot(1:500, col = gl(2,250)) Interestingly, with much shorter vectors of length (n), the correct warning is produced (n times). And once that has happened, you can use longer vectors without any problem. As you said ``issued just after starting R'' seems quite relevant. When run in 'R -d gdb', the backtrace ("bt") seems to indicate that the problem is happening during the (C-level) warning() call. Martin
Reasonably Related Threads
- pr[in]comp: predict single observation when data has colnames (PR#8324)
- Similar error as (PR#6958)
- Follow-up about ordinal logit with mixtures: how about 'continuation ratio' strategy?
- Two apparent bugs in aov(y~ *** -1 + Error(***)), with (PR#6523)
- Packages in R and in S-PLUS