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

Recursive list when list column is assigned a dt by reference #6488

Open
rikivillalba opened this issue Sep 9, 2024 · 1 comment
Open

Recursive list when list column is assigned a dt by reference #6488

rikivillalba opened this issue Sep 9, 2024 · 1 comment
Labels

Comments

@rikivillalba
Copy link
Contributor

rikivillalba commented Sep 9, 2024

This is somewhat related to #4877

library(data.table)
dt <- data.table(x = list(1,2,3))
dt[, y := .(list(dt))]
dt[, y]  
# Error: protect(): protection stack overflow

Since it is an obvious corner case, I'm not sure if it qualifies as bug or such situations must be managed with copy().

@MichaelChirico
Copy link
Member

I would normally call this a bug & say "stop playing with fire" :)

But just yesterday #4890 shows how we can probably fix this pretty easily by checking if x's own address is among the return values & inducing copy() automatically if so.

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

No branches or pull requests

2 participants