Running the following command will cause a segmentation fault and crash the R session:
pdist(matrix(0, 3, 3), list())
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1: .C("Rpdist", X.vec, Y.vec, nx, ny, p, distances = distances, NAOK = T)
2: pdist(matrix(1, 3, 3), list())
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
My quite unexhaustive debugging suggests that this only happens when Y=list() but that c(), NULL, data.frame() or list(1:3) are fine. The following also works:
Running the following command will cause a segmentation fault and crash the R session:
My quite unexhaustive debugging suggests that this only happens when
Y=list()
but thatc()
,NULL
,data.frame()
orlist(1:3)
are fine. The following also works: