ropensci / bikedata

:bike: Extract data from public hire bicycle systems
https://docs.ropensci.org/bikedata
81 stars 16 forks source link

store_bikedata for la results in memory not mapped segfault #58

Closed tbuckl closed 6 years ago

tbuckl commented 6 years ago

while trying out adding sf as discussed here, i found that the store_bikedata command (on current master and cran) for 'la' data might crash R with the following error:

so, for example:

library(bikedata)
store_bikedata (city = 'la', bikedb = 'bikedb', quiet = TRUE)

results in:

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: .Call(`_bikedata_rcpp_import_to_trip_table`, bikedb, datafiles,     city, quiet)
 2: rcpp_import_to_trip_table(bikedb, flists$flist_csv, ci, quiet)
 3: store_bikedata(city = "la", bikedb = "bikedb", quiet = TRUE)

it could be that i'm not doing it right!

nyc works though, as shown in the docs.

this is for R version 3.4.3

mpadge commented 6 years ago

Yeah, I've seen that error before, but haven't been able to systematically reproduce it. I'll dig a bit deeper

mpadge commented 6 years ago

Thanks @tibbl35. There are simply too many files for me to check all individually, so the ongoing functionality of the package really relies on people like you finding little glitches like this. In this case, the LA folk obviously process their data on a mac, and unknowingly bundle in some invisible OSX system data files with the actual trip data. These were causing the glitch which should now be fixed. Also helped to fix bug which means this nows works

store_bikedata (city = "la", bikedb = "bikedb", dates = c (201707, 201709))

The date processing previously failed for that file, but should now download and store only the 3rd quarter of that year, which is also the problematic file with the OSX junk in it. Thanks!