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

Setting alloccol and then making a DT with more than that many columns segfaults #970

Closed
caneff opened this issue Nov 25, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@caneff
Copy link

caneff commented Nov 25, 2014

I have datatable.alloccol set in my options (not even sure why any more, probably from helping with a rare segfault debug in an earlier version). When I make a DT with more than that many columns it segfaults. With the latest dev version and R 3.0.2:

options(datatable.verbose=TRUE)
options(datatable.alloccol=100)
library(data.table)
a=data.frame(matrix(1,ncol=100))  
data.table(a) # Works fine
a=data.frame(matrix(1,ncol=101))  
data.table(a) # Segfaults

The output when it segfaults (with things in {} removed):

> data.table(a)
*** glibc detected *** {path to R}/R: malloc(): memory corruption: {memory address} ***

I can just remove alloccol for now as I'm not sure it is still necessary. No alloccol and it works fine.

@arunsrinivasan
Copy link
Member

Please read completely and follow the instructions here. Thank you.

@caneff
Copy link
Author

caneff commented Dec 2, 2014

I don't understand what I'm missing. I told you it is the latest dev version of data.table and R 3.0.2, I gave a minimal reproducible example, and I don't see this bug already reported. What more are you looking for? Okay fine, it is isn't totally minimal as I was trying to show you where the edge case issue clearly is. The real minimal example:

options(datatable.alloccol=100)
library(data.table)
a=data.frame(matrix(1,ncol=101))  
data.table(a) 

@arunsrinivasan
Copy link
Member

@caneff
When I mean "completely", I really mean it. Even the > in code, and # for comments. On a second look, in this case, it seems to not matter much, but then it makes it clear that you've completely read the instructions.

It's also easier for us to if one shows the output (wherever relevant) - which is not necessary in your case again, but I wrote the comment here so that it doesn't happen on another post.

Thanks again. I don't get a segfault on my machine, but it errors instead:

# Error in alloc.col(ans) : attempt to set index 100/100 in SET_VECTOR_ELT
# data.table 1.9.5, R v3.1.2, Mac OS X, Yosemite 10.10.1

@arunsrinivasan
Copy link
Member

@caneff, have patched it. I don't see the error on my machine anymore. Could you please confirm on segfault please? Thanks.

@arunsrinivasan arunsrinivasan added this to the v1.9.6 milestone Jan 28, 2015
@arunsrinivasan arunsrinivasan self-assigned this Jan 28, 2015
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