Test failure : testSexp_deepcopy

Issue #469 resolved
Nehal J Wani
created an issue
FAIL: testSexp_deepcopy (rinterface.tests.test_Sexp.SexpTestCase)
Traceback (most recent call last):
  File "/path/to/lib/python3.6/site-packages/rpy2/rinterface/tests/test_Sexp.py", line 186, in testSexp_deepcopy
    self.assertEqual(2, sexp.named)
AssertionError: 2 != 3

Ran 428 tests in 10.581s

FAILED (failures=1, errors=2, skipped=15, expected failures=1)

Might matter: R uses mkl, not openblas

Comments (15)

  1. Nehal J Wani reporter

    R was compiled with the following flags:

        export MKL="-Wl,--no-as-needed -lmkl_gf_lp64 -Wl,--start-group -lmkl_gnu_thread  -lmkl_core  -Wl,--end-group -fopenmp  -ldl -lpthread -lm"
        ./configure --prefix=${PREFIX}               \
                    --host=${HOST}                   \
                    --build=${BUILD}                 \
                    --enable-shared                  \
                    --enable-R-shlib                 \
                    --enable-BLAS-shlib              \
                    --disable-prebuilt-html          \
                    --enable-memory-profiling        \
                    --with-tk-config=${TK_CONFIG}    \
                    --with-tcl-config=${TCL_CONFIG}  \
                    --with-x                         \
                    --with-pic                       \
                    --with-cairo                     \
                    --with-readline                  \
                    --with-recommended-packages=no   \
                    --without-libintl-prefix         \
                    --with-blas="$MKL"               \
                    --with-lapack                    \

    rpy2 was installed like this:

    python setup.py install --single-version-externally-managed --record=record.txt

    The tests were called like this:

    python -m rpy2.tests
  2. Laurent Gautier

    There seems to be changes in R with 3.5. I can either change the test to expect "3" or mark the test as expected to fail until I know more about the exact nature of changes (which will almost certainly tracking diff of what exactly changed in the R source).

  3. Nehal J Wani reporter

    I ran a git bisect using a git mirror and after approximately 8 builds, I found the culprit commit:

    (svn) [nwani@starlabs r-source]$ svn diff -r74078:74079 https://svn.r-project.org/R/                                                                                                                          
    Index: trunk/doc/NEWS.Rd
    --- trunk/doc/NEWS.Rd   (revision 74078)
    +++ trunk/doc/NEWS.Rd   (revision 74079)
    @@ -492,6 +492,11 @@
           \item \code{as.matrix(dd)} now works when the data frame \code{dd}
           contains a column which is a data frame or matrix, including a
           0-column matrix/d.f. .
    +      \item \code{NAMEDMAX} has been raised to 3 to allow protection of
    +      intermediate results from (usually ill-advised) assignments in
    +      arguments to \code{BUILTIN} functions. Package \code{C} code using
    +      \code{SET_NAMED} may need to be revised.
    Index: trunk/src/include/Rinternals.h
    --- trunk/src/include/Rinternals.h      (revision 74078)
    +++ trunk/src/include/Rinternals.h      (revision 74079)
    @@ -494,7 +494,7 @@
     #define IS_SIMPLE_SCALAR(x, type) \
         (IS_SCALAR(x, type) && ATTRIB(x) == R_NilValue)
    -#define NAMEDMAX 2
    +#define NAMEDMAX 3
     #define INCREMENT_NAMED(x) do {                                \
            SEXP __x__ = (x);                               \
            if (NAMED(__x__) != NAMEDMAX)                   \


  4. Laurent Gautier

    Awesome ! Thanks. So the fix for the unit test is correct.

    I still have the concern that I am experiencing a segfault when Python is exiting (and it seems to be triggered by decreasing the reference count of an R object), but this will go with #465.

  5. Log in to comment