You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attributes on environments are always a bad idea. No matter how convenient they may seem, the implementation doesn't support them in a reasonable way.
That said it would be nice not to segfault, which print(e) also does.
I've added some calls to R_Checkstack, which handle the object.size case.
print(e) triggers a buffer overflow in printAttributes; I've added a hack to trap that, but a cleaner rewrite with size checks would be better.
These changes are in r68574 in the trunk and r68575 in R-3-2-branch.
str(e) hilts a problem of cascading error calls when clean-up code is called after signalling an error because a resource is depleted. This is a long-standing issue with the way R calls clean-up code (before the jump instead of doing a series of jumps that release resources). It needs to be fixed eventually but probably won't be soon. I'm leaving the bug open as a reminder.
When an environment has a reference to itself in an attribute, it can result in a segfault when trying to inspect the environment.
# This is OK
e <- new.env()
e$e <- e
object.size(e)
# 56 bytes
# Using attributes causes segfault with object.size
e <- new.env()
attr(e, "e") <- e
object.size(e)
# Segmentation fault
# Similarly with str
e <- new.env()
attr(e, "e") <- e
str(e)
# Segmentation fault
METADATA
The text was updated successfully, but these errors were encountered: