search for: simplemmap

Displaying 7 results from an estimated 7 matches for "simplemmap".

2020 Oct 29
2
Something is wrong with the unserialize function
Hi all, I am not able to export an ALTREP object when `gctorture` is on in the worker. The package simplemmap can be used to reproduce the problem. See the example below ``` ## Create a temporary file filePath <- tempfile() con <- file(filePath, "wrb") writeBin(rep(0.0,10),con) close(con) library(simplemmap) library(parallel) cl <- makeCluster(1) x <- mmap(filePath, "double&quot...
2020 Oct 29
2
[External] Something is wrong with the unserialize function
...ll look into it when I get a chance unless someone else gets there first. A simpler reprex: ## create and serialize a memmory-mapped file object filePath <- "x.dat" con <- file(filePath, "wrb") writeBin(rep(0.0,10),con) close(con) library(simplemmap) x <- mmap(filePath, "double") saveRDS(x, file = "x.Rds") ## in a separate R process: gctorture() readRDS("x.Rds") Looks like a missing PROTECT somewhere. Best, luke On Thu, 29 Oct 2020, Jiefei Wang wrote: > Hi all,...
2020 Oct 29
0
[External] Something is wrong with the unserialize function
Thanks for the report. Will look into it when I get a chance unless someone else gets there first. A simpler reprex: ## create and serialize a memmory-mapped file object filePath <- "x.dat" con <- file(filePath, "wrb") writeBin(rep(0.0,10),con) close(con) library(simplemmap) x <- mmap(filePath, "double") saveRDS(x, file = "x.Rds") ## in a separate R process: gctorture() readRDS("x.Rds") Looks like a missing PROTECT somewhere. Best, luke On Thu, 29 Oct 2020, Jiefei Wang wrote: > Hi all, > > I am not able to export an ALTR...
2020 Oct 29
0
[External] Something is wrong with the unserialize function
...gt; someone else gets there first. > > A simpler reprex: > > ## create and serialize a memmory-mapped file object > filePath <- "x.dat" > con <- file(filePath, "wrb") > writeBin(rep(0.0,10),con) > close(con) > > library(simplemmap) > x <- mmap(filePath, "double") > saveRDS(x, file = "x.Rds") > > ## in a separate R process: > gctorture() > readRDS("x.Rds") > > Looks like a missing PROTECT somewhere. > > Best, > > luke > > On...
2018 Aug 09
4
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
On 9 August 2018 at 20:37, Tomas Kalibera wrote: | So to answer your original question, this could probably be handled in | Rcpp, Hm. Why do you say that / what did you have in mind? Recall that we do not alter SEXPs or introduce additional additional reference counters -- because we do not think that altering the basic R API for such calls would be a wise strategy. So we do more or less what
2018 Aug 09
0
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
...er or weak reference) with a C finalizer pointing into the space of the shared object being unloaded. So it is expected that R will segfault later when such finalizer is run. Currently there is no other way than to handle this on the side of the shared library/package, e.g. as Luke does in his simplemmap package. A library can declare R_unload_XXX function (see Writing R Extensions) that will be called before it is unloaded. So, one can keep say a list of objects with finalizers and clear/run the finalizers in R_unload_XXX. I don't think we could do this automatically on the R's side wi...
2018 Aug 06
2
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
Hi all, I'm not sure if I'm not supposed to do the following (the dyn.unload part, I mean) or this could be a bug (in R or Rcpp): ``` Rcpp::sourceCpp(code=' #include <Rcpp.h> class Object {}; //[[Rcpp::export]] SEXP new_object() { return Rcpp::XPtr<Object>(new Object()); }' ) new_object() dyn.unload(list.files(tempdir(), ".(so|dll)$",