collections
collections copied to clipboard
segfault when ht_xptr is missing for dict environment
> k = collections::dict()
> k$ht_xptr = NULL
> k$get("test")
*** caught segfault ***
address 0x108030040, cause 'memory not mapped'
Traceback:
1: k$get("test")
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
Maybe the C code should lock the environment binding or check the existent of ht_xptr
or hide ht_xptr
from users?
It is expected though.
OK
By the way, why you wanted to access the internal variables?
Just hanging around the c code and accidentally find a way to crash R.
It is brilliant to use the cons-list as a queue by the way.
But it is not a safe abstraction. I think the R package api should never crash user sessions. Instead, they should throw an R error for these cases.
Let’s keep it open.