-
Notifications
You must be signed in to change notification settings - Fork 979
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
[bug] fread handling embedded NUL characters #3400
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue is similar to several previous issues;
loading a file containing
NUL
ASCII character (in bytesas.raw(0)
), except that I have a minimal reproducible example which appears to cause a segfault on line fread.R@146This example is based on simulation software output where very rarely there can be
NUL
characters in the body of the file (issue #2485 has already resolvedNUL
characters at the end of a file). It appearsNUL
characters at the beginning of a file are acceptable as well.The header field is key=value pairs, and the data field is to be read into a data.table. In the example,
NUL
characters has been inserted into the body, you only need one to cause an error which cannot be caught with error handling.Verbose tracelog is provided using a file
test1.R
;Running
test1.R
;A different error can be achieved by inserting
NUL
characters at the beginning of the data field (after the header field) intest2.R
;Running
test2.R
;The data.table above loads with a warning, however it is not the correct size (0 rows and 1 cols).
If you change the inserted byte to anything other than 0 [1 - 255],
fread
works fine (by including the byte in one of the data.table elements).The text was updated successfully, but these errors were encountered: