Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-02-01 Thread Paul Johnson
I confirm you have a solution with GitHub Rcpp. Thanks very much for your effort. pj On Mon, Feb 1, 2016 at 12:06 PM, Qiang Kou wrote: > Hi, Paul, > > I am sorry I deleted the branch after merging. > > You can just do as Jonathan said. > > Best wishes, > > KK > > On Mon, Feb 1, 2016 at 11:16 A

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-02-01 Thread Qiang Kou
Hi, Paul, I am sorry I deleted the branch after merging. You can just do as Jonathan said. Best wishes, KK On Mon, Feb 1, 2016 at 11:16 AM, Paul Johnson wrote: > Thanks, KK for studying this one. > > Am I doing this wrong? > > > devtools::install_github("thirdwing/Rcpp", ref = "subsetter") >

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-02-01 Thread Jonathan Olmsted
Any reason not to get it from RcppCore/Rcpp? History shows the fix was pulled in: https://github.com/RcppCore/Rcpp/commits/master On my end, I just installed Rcpp via > install_github("RcppCore/Rcpp") and then re-installed openxlsx from CRAN via > install.packages("openxlsx") The script I ha

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-02-01 Thread Paul Johnson
Thanks, KK for studying this one. Am I doing this wrong? > devtools::install_github("thirdwing/Rcpp", ref = "subsetter") Downloading GitHub repo thirdwing/Rcpp@subsetter from URL https://api.github.com/repos/thirdwing/Rcpp/zipball/subsetter Error in download(dest, src, auth) : Not Found (HTTP 404

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Dirk Eddelbuettel
On 30 January 2016 at 13:58, Kevin Ushey wrote: | And I now have a MRE: | | #include | using namespace Rcpp; | | // [[Rcpp::export]] | IntegerVector ouch(IntegerVector x, IntegerVector y) { | IntegerVector result; | result = x[y - 1]; | return result; | } | | /*** R | x <- 1:1E6 | y <- 1

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Kevin Ushey
And I now have a MRE: #include using namespace Rcpp; // [[Rcpp::export]] IntegerVector ouch(IntegerVector x, IntegerVector y) { IntegerVector result; result = x[y - 1]; return result; } /*** R x <- 1:1E6 y <- 1:1E6 gctorture(TRUE) x <- ouch(x, y) gctorture(FALSE) */ This fails pretty rel

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Kevin Ushey
I think I know what's going on now. Effectively, we're 'evaluating' the sugar proxy vector, getting a pointer to a (temporary, unprotected) R data structure, and then storing that pointer. Later, when we attempt to allocate the output vector (with `no_init`) the GC runs and cleans up our pointer.

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Qiang Kou
Another thing confused me is the segfault only happens when the IntegerVector is significantly long. Best, KK On Sat, Jan 30, 2016 at 2:57 AM, Kevin Ushey wrote: > Hmm, I have one thought: we try to re-use the indices from an > IntegerVector, but the type here is actually a sugar type: > >

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Kevin Ushey
Hmm, I have one thought: we try to re-use the indices from an IntegerVector, but the type here is actually a sugar type: Rcpp::SubsetProxy<13, Rcpp::PreserveStorage, 13, true, Rcpp::sugar::Minus_Vector_Primitive<13, true, Rcpp::Vector<13, Rcpp::PreserveStorage> > >::get_vec (this=) Ie

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Dirk Eddelbuettel
On 29 January 2016 at 17:55, Qiang Kou wrote: | Hi, Paul, can you try my fork of Rcpp? You can install it by the line below: | | devtools::install_github("thirdwing/Rcpp", ref = "subsetter") | | This fixed the segfault on my Ubuntu machine. Yay. Nice work! | The difference can be found from [

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Qiang Kou
Hi, Paul, can you try my fork of Rcpp? You can install it by the line below: devtools::install_github("thirdwing/Rcpp", ref = "subsetter") This fixed the segfault on my Ubuntu machine. The difference can be found from [1]. In *subsetter*, if an IntegerVector passed in, we will try to reuse it.

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Qiang Kou
Hi, Kevin, I was also trying to track this down yesterday. >From the debugging info below, *indices_n* is not equal to length of *indices*, which I don't quite understand. Program received signal SIGSEGV, Segmentation fault. 0x72ed5c4e in Rcpp::SubsetProxy<13, Rcpp::PreserveStorage, 13,

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Dirk Eddelbuettel
On 29 January 2016 at 11:27, Kevin Ushey wrote: | When I add some debug printing to the associated subscripting line | (https://github.com/awalker89/openxlsx/blob/b92bb3acdd6ea759be928c298c6faeef2f26fa3e/src/cppFunctions.cpp#L2608), | I see: | |colNumbers.size(): 98,03,150 |charCols.size

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Kevin Ushey
When I add some debug printing to the associated subscripting line (https://github.com/awalker89/openxlsx/blob/b92bb3acdd6ea759be928c298c6faeef2f26fa3e/src/cppFunctions.cpp#L2608), I see: colNumbers.size(): 98,03,150 charCols.size(): 95,94,546 It looks to me like the package is erroneously

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Dirk Eddelbuettel
On 28 January 2016 at 21:47, Paul Johnson wrote: | Thanks. | | On Thu, Jan 28, 2016 at 2:42 PM, Dirk Eddelbuettel wrote: | > | > Paul, | > | > I can reproduce the segfault on Ubuntu 15.10, "everything current". | > Definitely a valid bug report, though a 30mb xlsx may not qualify as | > minimal.

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Paul Johnson
Thanks. On Thu, Jan 28, 2016 at 2:42 PM, Dirk Eddelbuettel wrote: > > Paul, > > I can reproduce the segfault on Ubuntu 15.10, "everything current". > Definitely a valid bug report, though a 30mb xlsx may not qualify as > minimal. > I'm glad I did not attach it to an email, then :) The data xlsx

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Dirk Eddelbuettel
On 28 January 2016 at 17:42, Qiang Kou wrote: | No errors on OSX with R 3.2.2. | | Rcpp and openxlsx are installed from CRAN with type = "source". Very helpful -- thank you! Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | [email protected] ___

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Qiang Kou
No errors on OSX with R 3.2.2. Rcpp and openxlsx are installed from CRAN with type = "source". KK On Thu, Jan 28, 2016 at 4:59 PM, Dirk Eddelbuettel wrote: > > Paul, > > It does not appear to be a new bug. As this was easily scriptable, I tested > Rcpp 0.12.3, 0.12.2, 0.12.1, 0.12.0, 0.11.6, 0

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Dirk Eddelbuettel
Paul, It does not appear to be a new bug. As this was easily scriptable, I tested Rcpp 0.12.3, 0.12.2, 0.12.1, 0.12.0, 0.11.6, 0.11.5 and 0.11.4 -- all by getting the tarball off CRAN, installing, re-installing openxlsx and then running your script. They all died by segfault. It may be an old bu

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Dirk Eddelbuettel
Paul, I can reproduce the segfault on Ubuntu 15.10, "everything current". Definitely a valid bug report, though a 30mb xlsx may not qualify as minimal. I won't have time to look at this for a while though so if you find that downgrading helps that may be your best bet. Thanks for the report. I

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Kevin Ushey
Thanks -- this is helpful. Based on the stack trace, it looks like the error is coming out of here: https://github.com/awalker89/openxlsx/blob/b92bb3acdd6ea759be928c298c6faeef2f26fa3e/src/cppFunctions.cpp#L2608 Whether this is an error in the Rcpp SubsetProxy class, or the vectors the package aut

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Paul Johnson
Thanks. It has been a while since I used gdb, and I can't recall doing it with R. It looks discouraging to me because I see "" in the symbols. I have to re-learn what symbols are and where to get them. I deleted openxlsx and got clean re-install before trying this. What's this one mean? warnin

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Kevin Ushey
A C++ stack trace would be very helpful. Can you try running R with gdb, e.g. R -d gdb -f example.R where 'example.R' is the path to your script that reproduces the segfault? Hopefully, 'gdb' can provide more context on where the error is occurring. For what it's worth, the file did open suc

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Dirk Eddelbuettel
Paul, Advice is always the same: fresh compilation of all dependent packages. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | [email protected] ___ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.or