[Rd] Seg fault stats::runmed

Hilmar Berger berger @ending from mpiib-berlin@mpg@de
Fri Oct 5 10:17:49 CEST 2018


Dear all,

I just found this issue:

dd1 = c(rep(NaN,82), rep(-1, 144), rep(1, 74))
xx = runmed(dd1, 21)

-> R crashes reproducibly in R 3.4.3, R3.4.4 (Ubuntu 14.04/Ubuntu 16.04)

With GDB:
Program received signal SIGSEGV, Segmentation fault.
swap (l=53, r=86, window=window using entry=0xc59308, 
outlist=outlist using entry=0x12ea2e8, nrlist=nrlist using entry=0x114fdd8, 
print_level=print_level using entry=0) at Trunmed.c:64
64        outlist[nr/* = nrlist[l] */] = l;

Valgrind also reports access to unallocated memory and/or writing past 
the end of the heap.

The crash does not happen if the order is changed:

dd2 = c(rep(-1, 144), rep(1, 74), rep(NaN,82))
xx = runmed(dd2,21)

Error in if (a < b) { : missing value where TRUE/FALSE needed

Best regards,
Hilmar

-- 
Dr. Hilmar Berger, MD
Max Planck Institute for Infection Biology
Charitéplatz 1
D-10117 Berlin
GERMANY

Phone:  + 49 30 28460 430
Fax:    + 49 30 28460 401
  
E-Mail: berger using mpiib-berlin.mpg.de
Web   : www.mpiib-berlin.mpg.de



More information about the R-devel mailing list