[Rd] Unlikely use case of debug() that cause R to crash

From: Henrik Bengtsson <hb_at_biostat.ucsf.edu>
Date: Thu, 05 Apr 2012 13:17:17 -0700


FYI, PROBLEM:
R will crash if one tries to use debug() during startup, i.e. in a user profile file.

REPRODUCIBLE EXAMPLE:
Create ~/.Rprofile with:

cat("~/.Rprofile...\n")
debug(cat)
cat("~/.Rprofile...done\n")

and do

% R --no-environ --no-environ --no-restore --silent

~/.Rprofile...
debugging in: cat("~/.Rprofile...done\n") debug: {

    if (is.character(file))

        if (file == "")
            file <- stdout()
        else if (substring(file, 1L, 1L) == "|") {
            file <- pipe(substring(file, 2L), "w")
            on.exit(close(file))
        }
        else {
            file <- file(file, ifelse(append, "a", "w"))
            on.exit(close(file))
        }

    .Internal(cat(list(...), file, sep, fill, labels, append)) }
Browse[2]>

R will crash as soon as you try to do anything at the debug prompt.

> sessionInfo()
R version 2.15.0 Patched (2012-04-03 r58917) Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

/Henrik



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 05 Apr 2012 - 20:19:45 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Apr 2012 - 11:10:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive