Skip to content
Prev 5833 / 10988 Next

[Rcpp-devel] Segfault error during simulation in Rcpp

Sorry yesterday evening by mistake I sent a message only to Dirk:

Thanks, you are right I'll try cxxfunction and/or I'll see whether I can
move avoid doing so many calls to C++.

For the sake of minimality: this code is enough to have a segfault or to
make R stall
(at least on my computer):

library(Rcpp)
myFun <- cppFunction('NumericMatrix myFun(NumericMatrix input){ return
input; }')

n <- 10
x <- 1:n^2
N <- 1e6
b <- 0
A <- matrix(x, n, n)
for (j in 1:N) {
    res <- myFun(A)
    a <- res[1,1]
    b <- b + a
}

cat(sprintf("Done, b is %d\n", b))

Thanks a lot to everybody for the help!
On Fri, May 17, 2013 at 4:17 AM, Ivan Popivanov <ivan.popivanov at gmail.com>wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130517/cf32ae23/attachment.html>

Thread (27 messages)

Matteo Fasiolo Segfault error during simulation in Rcpp May 6 Douglas Bates Segfault error during simulation in Rcpp May 6 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 6 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 6 Matteo Fasiolo Segfault error during simulation in Rcpp May 6 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 6 Matteo Fasiolo Segfault error during simulation in Rcpp May 6 Jared Murray Segfault error during simulation in Rcpp May 9 Matteo Fasiolo Segfault error during simulation in Rcpp May 16 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 16 Matteo Fasiolo Segfault error during simulation in Rcpp May 16 Kevin Ushey Segfault error during simulation in Rcpp May 16 Jonathan Olmsted Segfault error during simulation in Rcpp May 16 Xiao He Segfault error during simulation in Rcpp May 16 Matteo Fasiolo Segfault error during simulation in Rcpp May 16 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 16 Xiao He Segfault error during simulation in Rcpp May 16 Jonathan Olmsted Segfault error during simulation in Rcpp May 16 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 16 Matteo Fasiolo Segfault error during simulation in Rcpp May 16 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 16 Jonathan Olmsted Segfault error during simulation in Rcpp May 16 Dirk Eddelbuettel Segfault error during simulation in Rcpp May 16 Ivan Popivanov Segfault error during simulation in Rcpp May 16 Ivan Popivanov Segfault error during simulation in Rcpp May 16 Matteo Fasiolo Segfault error during simulation in Rcpp May 17 Matteo Fasiolo Segfault error during simulation in Rcpp May 17