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

Kevin Ushey kevinushey at gmail.com
Thu Jan 28 21:10:34 CET 2016


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 authors are using, or, some strange local system issue,
remains to be seen.

Can you try installing the development of both Rcpp and openxlsx just
to see if you can reproduce? You can install the corresponding
versions from GitHub, using e.g.

    devtools::install_github("RcppCore/Rcpp")
    devtools::install_github("awalker89/openxlsx")

I'll see if I can reproduce on an Ubuntu machine later as well.

Thanks,
Kevin

On Thu, Jan 28, 2016 at 11:54 AM, Paul Johnson <pauljohn32 at gmail.com> wrote:
> 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 "<optimized out>" 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?
>
> warning: Source file is more recent than executable.
>
> Anywhere, here it is:
>
> $ R -d gdb -f Reproducible_openxlsx_failure.R
> GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /usr/lib/R/bin/exec/R...(no debugging symbols
> found)...done.
> (gdb) run
> Starting program: /usr/lib/R/bin/exec/R -f Reproducible_openxlsx_failure.R
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>
> R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>>
>> library(openxlsx)
>>
>> sessionInfo()
> R version 3.2.3 (2015-12-10)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 15.10
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] openxlsx_3.0.0
>
> loaded via a namespace (and not attached):
> [1] Rcpp_0.12.3
>>
>> dat <- read.xlsx("Failure_to_Import.xlsx", colNames = TRUE)
>
> Program received signal SIGSEGV, Segmentation fault.
> Rcpp::SubsetProxy<13, Rcpp::PreserveStorage, 13, true,
> Rcpp::sugar::Minus_Vector_Primitive<13, true, Rcpp::Vector<13,
> Rcpp::PreserveStorage> > >::get_vec (this=<optimized out>)
>     at /home/pauljohn/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include/Rcpp/vector/Subsetter.h:199
> warning: Source file is more recent than executable.
> 199                 output[i] = lhs[ indices[i] ];
> (gdb) backtrace
> #0  Rcpp::SubsetProxy<13, Rcpp::PreserveStorage, 13, true,
> Rcpp::sugar::Minus_Vector_Primitive<13, true, Rcpp::Vector<13,
> Rcpp::PreserveStorage> > >::get_vec (this=<optimized out>)
>     at /home/pauljohn/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include/Rcpp/vector/Subsetter.h:199
> #1  Rcpp::SubsetProxy<13, Rcpp::PreserveStorage, 13, true,
> Rcpp::sugar::Minus_Vector_Primitive<13, true, Rcpp::Vector<13,
> Rcpp::PreserveStorage> > >::operator Rcpp::Vector<13,
> Rcpp::PreserveStorage> (this=<optimized out>)
>     at /home/pauljohn/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include/Rcpp/vector/Subsetter.h:125
> #2  readWorkbook (v=..., r=..., string_refs=..., is_date=...,
> nRows=34999, nRows at entry=35000,
>     hasColNames=hasColNames at entry=true, skipEmptyRows=true,
> originAdj=25569, clean_names=...) at cppFunctions.cpp:2448
> #3  0x00007ffff2e607c0 in openxlsx_readWorkbook (vSEXP=<optimized
> out>, rSEXP=0x7fffee37e010,
>     string_refsSEXP=0x7fffaf0a9010, is_dateSEXP=0x214d7e8,
> nRowsSEXP=<optimized out>, hasColNamesSEXP=<optimized out>,
>     skipEmptyRowsSEXP=0x212e6f8, originAdjSEXP=0x2145428,
> clean_namesSEXP=0x22f92f0) at RcppExports.cpp:580
> #4  0x00007ffff78f0550 in ?? () from /usr/lib/R/lib/libR.so
> #5  0x00007ffff78f0948 in ?? () from /usr/lib/R/lib/libR.so
> #6  0x00007ffff792c108 in Rf_eval () from /usr/lib/R/lib/libR.so
> #7  0x00007ffff792f52e in ?? () from /usr/lib/R/lib/libR.so
> #8  0x00007ffff792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so
> #9  0x00007ffff792de88 in ?? () from /usr/lib/R/lib/libR.so
> #10 0x00007ffff792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so
> #11 0x00007ffff7931909 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
> #12 0x00007ffff79612b8 in ?? () from /usr/lib/R/lib/libR.so
> #13 0x00007ffff796171f in ?? () from /usr/lib/R/lib/libR.so
> #14 0x00007ffff7961986 in ?? () from /usr/lib/R/lib/libR.so
> #15 0x00007ffff792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so
> #16 0x00007ffff792de88 in ?? () from /usr/lib/R/lib/libR.so
> #17 0x00007ffff792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so
> #18 0x00007ffff7931909 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
> #19 0x00007ffff792bcef in Rf_eval () from /usr/lib/R/lib/libR.so
> #20 0x00007ffff792f52e in ?? () from /usr/lib/R/lib/libR.so
> #21 0x00007ffff792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so
> #22 0x00007ffff795422a in Rf_ReplIteration () from /usr/lib/R/lib/libR.so
> #23 0x00007ffff7954591 in ?? () from /usr/lib/R/lib/libR.so
> #24 0x00007ffff7954af4 in run_Rmainloop () from /usr/lib/R/lib/libR.so
> #25 0x00000000004007eb in main ()
> #26 0x00007ffff7257a40 in __libc_start_main (main=0x4007d0 <main>,
> argc=3, argv=0x7fffffffde88, init=<optimized out>,
>     fini=<optimized out>, rtld_fini=<optimized out>,
> stack_end=0x7fffffffde78) at libc-start.c:289
> #27 0x0000000000400829 in _start ()
>
> pj
>
>
>
> On Thu, Jan 28, 2016 at 1:40 PM, Kevin Ushey <kevinushey at gmail.com> wrote:
>> 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 successfully for me, using R
>> 3.2.3 patched (r69960) + Rcpp 0.12.3, openxlsx_3.0.0, on OS X.
>>
>> Thanks,
>> Kevin
>>
>> On Thu, Jan 28, 2016 at 11:33 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
>>>
>>> Paul,
>>>
>>> Advice is always the same: fresh compilation of all dependent packages.
>>>
>>> Dirk
>>>
>>> --
>>> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>>> _______________________________________________
>>> 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
>
>
>
> --
> Paul E. Johnson
> Professor, Political Science        Director
> 1541 Lilac Lane, Room 504      Center for Research Methods
> University of Kansas                 University of Kansas
> http://pj.freefaculty.org              http://crmda.ku.edu


More information about the Rcpp-devel mailing list