Skip to content

another R crash issue

3 messages · Simon Urbanek, Brian Ripley, riccardo zincarelli

#
This is a clear bug in gmp (the R package) - simply division by zero in

templateMatrix.h:126:    return this->size() / nRows();

  * frame #0: 0x00000001076e1b12 gmp.so`math::Matrix<bigrational>::nCols(this=0x00007ffeefbfc5d8) const at templateMatrix.h:126:25 [opt]
    frame #1: 0x00000001076ea253 gmp.so`matrixz::bigint_transpose(mat=0x00007ffeefbfc5d8) at matrix.cc:484:23 [opt]
    frame #2: 0x00000001076eb3be gmp.so`::biginteger_rbind(args=0x0000000108a60848) at matrix.cc:459:12 [opt]

i.e., bigint_transpose() cannot deal with 0-row matrices. That may be just the tip of the ice berg, even biginteger_rbind itself should probably just skip zero-length objects.

Cheers,
Simon
2 days later
#
On 01/12/2022 21:00, Simon Urbanek wrote:
My macOS build showed a different issue which also needs correcting:

 > rbind(NULL, as.bigz(c(1,3)))
Big Integer ('bigz') Error in sprintf("%d x %d matrix", nr, n/nr) :
   invalid format '%d'; use format %f, %e, %g or %a for numeric objects

but I get a segfault on Linux.

There are two instances in gmp/R:

biginteger.R:        sprintf("%d x %d matrix", nr, n/nr)
bigq.R:        sprintf("%d x %d matrix", nr, n/nr)

Note too that n in

   if((n <- length(x)) > 0) {

need not be of integer type, and n/nr never will be.

  
    
#
I am receiving email that I am involve in it , please stop

Il giorno dom 4 dic 2022 alle 11:25 Prof Brian Ripley <ripley at stats.ox.ac.uk>
ha scritto: