[Rcpp-devel] Rcpp & multicore: segfault due to unmapped memory

Dirk Eddelbuettel edd at debian.org
Fri Dec 9 17:19:31 CET 2011

On 9 December 2011 at 16:12, Stefano Calza wrote:
| Hi everybody
| I built my very first package using Rcpp for doing some intense computing on sequencing data.
| Now it works fine if I run it sequentially. But I want to take advantage of multicore platform so I'm using "parallel".
| And here I have a very unpredictable behaviour. Every now and then I get segfault due to unmapped memory. And only on parallel execution, never serial.
| I have several functions, but I is the wrapper called by mclapply. Here all SEXP arguments are then turned to Rcpp objects using clone(). Afaik they are deep copied.
| Looks like the different spawned process sometimes try to work on the same memory slot. But how can it be?
| Also the behaviour is really unpredictable. Sometimes it happens, sometimes it doesn't. Using mc.preschedule=TRUE all runs should be reproducible, but this is not the case.
| I never had any trouble in using code written with "the standard" .C interface using multicore & Co.
| So do anybody has any hint on where can I look for this bug?

You need to give us a reproducible example if you want us to help you.  What
you describe above is way too vague.

| Thanks
| Stefano
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx

More information about the Rcpp-devel mailing list