Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcaugth segfault with fread() and tables(), memory not mapped (with TRY plant trait database) #3369
Comments
|
Thank you for the report. Confirmed for Windows too. |
|
The
|
|
Dear HughParsonage, So, I can not work with the database and just a few months ago it works perfectly. |
|
Hi gorne, No sorry I don't know how to fix. It's definitely a bug so thank you for reporting. Hopefully someone with better experience with the fread C code can fix. Once the maintainers have the time to put their mind to it, a fix will be applied. You may wish to consider the following temporary fix (noting the warning about the blank penultimate line). fread("4636.txt",
sep = "\t",
colClasses = list("integer" = c("RelUncertaintyPercent", "Replicates")),
quote = "") |
|
Thank you very much, it seems to work. |
|
@HughParsonage For me your command emits the following warning:
even though that last line is not a "single-line footer" but a real data record. As much as I can see it's valid too, it even has same 28 fields as the rest of the file. That line can be read separately via
and then |
|
The following code samples seem to show that subset is also vulnerable to this segfault bug. Toggle code params accordingly. Rolling back to version 1.11.8 fixes this particular problem under a few environments tested. |
|
PR #3469 (v1.12.2) catches the malformed data.table and avoid the segfaults. PR #3471 (v1.12.4) unpacks the data.frame column that is a data.frame to solve the malformed data.table which causes the problem @drewabbot reported just above. I reproduced and traced the |
###########################The problem
I can not provide a reduced example because I do not know where the problem is. So I give you the entire database and e few lines where the problem appears. Few months ago I worked perfectly with the same database.
The database have 1.3 GB (1,345,078,529 bytes)
The file database is "4636.txt" or "here"
library(data.table)data <- fread("4636.txt", header = T, sep = "\t", dec = ".", quote = "", data.table = T)tables()It produces the following message:
###########################Output of sessionInfo()
sessionInfo()###########################But I also try with:
###########################
When I ran the same script on valgrind I obtain:
library(data.table)data <- fread("4636.txt", header = T, sep = "\t", dec = ".", quote = "", data.table = T)tables()