Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault when ht_xptr is missing for dict environment #13

Open
qinwf opened this issue Jun 21, 2020 · 5 comments
Open

segfault when ht_xptr is missing for dict environment #13

qinwf opened this issue Jun 21, 2020 · 5 comments

Comments

@qinwf
Copy link

qinwf commented Jun 21, 2020

> 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?

@randy3k
Copy link
Owner

randy3k commented Jun 21, 2020

It is expected though.

@qinwf
Copy link
Author

qinwf commented Jun 21, 2020

OK

@qinwf qinwf closed this as completed Jun 21, 2020
@randy3k
Copy link
Owner

randy3k commented Jun 21, 2020

By the way, why you wanted to access the internal variables?

@qinwf
Copy link
Author

qinwf commented Jun 22, 2020

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.

@randy3k randy3k reopened this Jun 22, 2020
@randy3k
Copy link
Owner

randy3k commented Jun 22, 2020

Let’s keep it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants