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

fread fails when max_nrows argument is too small #2243

Closed
st-pasha opened this issue Jul 4, 2017 · 0 comments
Closed

fread fails when max_nrows argument is too small #2243

st-pasha opened this issue Jul 4, 2017 · 0 comments
Assignees
Milestone

Comments

@st-pasha
Copy link
Contributor

st-pasha commented Jul 4, 2017

Example:

> fread("~/github/h2oai-benchmarks/Data/Homesite/train.csv", nrows=10)

 *** caught segfault ***
address 0x2596, cause 'memory not mapped'
R(60974,0x700000804000) malloc: *** error for object 0x7f97e8d9c0b8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Reason: around line 1794 we compute size_t initialBuffRows = allocnrow / (size_t)nJumps;. Here allocnrow is small (set by the user), while nJumps is large (determined by the file size). As a result, 0 rows are allocated for the buffers, and subsequently any attempt to write into them causes a segfault.

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

No branches or pull requests

1 participant