0

I am trying to deploy a package to CRAN, but I'm getting errors in the Windows version's unit tests. This is the (probably) relevant part of the log file from CRAN:

** running tests for arch 'i386' ... [36s] ERROR
  Running 'testthat.R' [34s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(mrf2d)
  > 
  > test_check("mrf2d")
  -- 1. Error: Pseudo-likelihood computing is correct (@test-pseudo_likelihood.R#1
  GC encountered a node (0x08ca70b0) with an unknown SEXP type: 30 at memory.c:1784
  Backtrace:
   1. mrf2d::fit_pl(...)
   5. mrf2d:::fn(par, ...)
   6. mrf2d::pl_mrf2d(Z, mrfi, theta)
   7. mrf2d:::pl_nosub(Z, mrfi, theta, log_scale)
   8. mrf2d:::log_pl_mrf(Z, R, theta)

  -- 2. Error: Gibbs Sampler works with sub_region and fixed_region (@test-rmrf2d.
  GC encountered a node (0x08ca70b0) with an unknown SEXP type: 30 at memory.c:1784
  Backtrace:
   1. testthat::expect_warning(...)
   2. testthat:::quasi_capture(enquo(object), label, capture_warnings)
   4. rlang::quo_label(.quo)
   5. rlang::expr_label(quo_squash(quo))
   6. rlang:::deparse_one(expr)
   7. rlang::is_call(expr, function_sym)

All tests passed for arch 'x64'. I installed windows on a computer to reproduce the errors but sessionInfo() tells me Running under: Windows 10 x64 (build 18362), so I think can't reproduce the error to find what is wrong and I don't understand what the error message means.

  • Is it possible to reproduce the conditions where the errors occur in this computer?
  • What are the likely causes of encountered a node (0x08ca70b0) with an unknown SEXP type: 30 at memory.c:1784 and how should I try to fix it?
VFreguglia
  • 2,129
  • 4
  • 14
  • 35
  • 1
    Errors one cannot reproduce are always frustrating. You do have access to win-builder and rhub though. And pardon me for asking: where is the relationship to Rcpp here? – Dirk Eddelbuettel Nov 10 '19 at 19:45
  • I actually lack the knowledge on Windows and compilers to precisely define what are the good tags for the question. The errors happened in functions written in `Rcpp`, so I thought it could be something related to it. I would gladly edit the tags if you have any suggestions. – VFreguglia Nov 10 '19 at 19:58
  • 2
    When I encounter problems that are hard to reproduce given that you don't have access to a Windows machine, I iteratively comment out tests, rebuild, then resubmit to win-builder until I can pin-point the test that gives the error. Once you have identified the test, you can follow the crumbs to your faulty code. It's not as hard as it sounds. It's just a bit of determination. – Joseph Wood Nov 10 '19 at 21:24
  • @JosephWood win-builder does help a lot in this situation as you and Dirk Eddelbuettel mentioned. I still don't understand how to figure out what is wrong if the tests pass on x64 architecture, i.e., I can't understand how the same code can be correct under an architecture and faulty under the other. – VFreguglia Nov 11 '19 at 14:53
  • @Freguglia, I was hoping not to give everything away. As I said earlier, you will have to identify the test(s) which is causing the failure. Now, since i386 is a 32-bit architecture coupled with the fact that all tests pass on x64, this tells us that there is a high probability that we should be looking for integer overflow situations. For example, on some systems `sizeof(long) = 4` and others it is`8`. Hope this helps. – Joseph Wood Nov 11 '19 at 15:48
  • 1
    After two days and nearly 20 interactions with win-builder, I finally found out I had an `IntegerVector` declared with no specified size causing memory leaks. It was probably also present in the 64-bit architecture, but I assume it was very unlikely to cause errors (with my limited C++ knowledge). Your hint was really useful so I did stop looking for the wrong type of problems! – VFreguglia Nov 12 '19 at 23:58
  • 1
    @Freguglia, I'm glad you figured it out and reported back. These things are incredibly frustrating however the experience you've gained from this problem is extremely valuable. – Joseph Wood Nov 13 '19 at 12:50

0 Answers0