[Bioc-devel] Strange "internal logical NA value has been modified" error

Pariksheet Nanda p@r|k@heet@n@nd@ @end|ng |rom uconn@edu
Wed Oct 13 04:29:36 CEST 2021

Hi all,

On 10/12/21 6:43 PM, Pariksheet Nanda wrote:
> Error in `...`: internal logical NA value has been modified

In the R source code, this error is in src/main/memory.c so I was 
thinking one way of investigating might be to run `R --debugger gdb`, 
then running R to load the symbols and either:

1) set a breakpoint for when it reaches that particular line in 
memory.c:R_gc_internal and then walk up the stack,

2) or set a watch point on memory.c:R_gc_internal:R_LogicalNAValue 
(somehow; having trouble getting gdb to reach that context).

3) Then I thought, maybe this is getting far into the weeds and instead 
I could check the most common C related error by enabling bounds 
checking of my C arrays per section 4.4 of the R-exts manual:

$ R -q
 > options(CBoundsCheck = TRUE)
 > Sys.setenv(R_C_BOUNDS_CHECK = "yes") # Try both ways *shrug*
 > devtools::test()
... # All tests still pass.
 > devtools::check()
... # No change :(

Maybe I'm not sure I'm using that option correctly?  Or the option is 
ignored in devtools::check().  Or indeed, the error is not from over 
running C array boundaries.

It turns out that using the precompiled debug symbols[1] isn't all that 
useful here because I don't get line numbers in gdb without the source 
files and many symbols are optimized out, so it looks like I would need 
to compile R from source with -ggdb first instead of using the Debian 

Hopefully this is still the right approach?


[1] After install r-base-core-dbg on Debian for the debug symbols.

More information about the Bioc-devel mailing list