[Rd] crash bug in get("function.name")() (PR#1211)

Uwe Ligges ligges@statistik.uni-dortmund.de
Wed, 12 Dec 2001 00:05:16 +0100


rmh@surfer.sbm.temple.edu wrote:
> 
> R : Copyright 2001, The R Development Core Team
> Version 1.3.1  (2001-08-31)
> 
> > tmp <- factor(1:3)
> > get("print.factor")(tmp)
> [1] 1 2 3
> Levels:  1 2 3
> > print.a <- function(x,...) {
> +   print("this is a")
> +   NextMethod("print", x, quote = FALSE, right = TRUE, ...)
> + }
> >
> > get("print.a")
> function(x,...) {
>   print("this is a")
>   NextMethod("print", x, quote = FALSE, right = TRUE, ...)
> }
> > print.a(tmp)
> [1] "this is a"
> [1] 1 2 3
> Levels:  1 2 3
> > get("print.a")(tmp)
> [1] "this is a"
> 
> Process R exited abnormally with code 5 at Tue Dec 11 16:18:17 2001
> 
> ----
> 
> I am using the windows version rw1031
> 
> I also tried on rw1030.   rw1030 gives a different code
> Process R exited abnormally with code 255 at Tue Dec 11 17:31:06 2001


With an existing workspace the same happens with R-1.4.0 (unstable) on
WinNT4.

Also in R-1.4.0 (unstable) the last lines of your example, if started
without an existing workspace, results in:

>  print.a(tmp)
[1] "this is a"
[1] 1 2 3
Levels:  1 2 3 
>  get("print.a")(tmp)
[1] "this is a"
Error in get("print.a")(tmp) : function is not a closure
>  get("print.a")
Error: attempt to apply non-function
>  get 
#### Now a crash!


Uwe
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._