{"action":"created","issue":{"url":"https://api.github.com/repos/tidyverse/haven/issues/342","repository_url":"https://api.github.com/repos/tidyverse/haven","labels_url":"https://api.github.com/repos/tidyverse/haven/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/tidyverse/haven/issues/342/comments","events_url":"https://api.github.com/repos/tidyverse/haven/issues/342/events","html_url":"https://github.com/tidyverse/haven/issues/342","id":290863424,"number":342,"title":"Unable to allocate memory — haven 1.1.1","user":{"login":"BERENZ","id":3464669,"avatar_url":"https://avatars2.githubusercontent.com/u/3464669?v=4","gravatar_id":"","url":"https://api.github.com/users/BERENZ","html_url":"https://github.com/BERENZ","followers_url":"https://api.github.com/users/BERENZ/followers","following_url":"https://api.github.com/users/BERENZ/following{/other_user}","gists_url":"https://api.github.com/users/BERENZ/gists{/gist_id}","starred_url":"https://api.github.com/users/BERENZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BERENZ/subscriptions","organizations_url":"https://api.github.com/users/BERENZ/orgs","repos_url":"https://api.github.com/users/BERENZ/repos","events_url":"https://api.github.com/users/BERENZ/events{/privacy}","received_events_url":"https://api.github.com/users/BERENZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-01-23T14:44:50Z","updated_at":"2018-02-02T12:48:54Z","closed_at":null,"author_association":"NONE","body":"I have the following problem with `read_spss/read_sav`. Code work perfectly for previous version of `haven` package but after updating I got an an error which indicate a problem with allocating memory.\r\n\r\nI attach code, the [file](https://github.com/tidyverse/haven/files/1656323/BKL_oferty_pracy_1ed.sav.zip) and other information. \r\n\r\nI tested this on two R versions (R MRAN & vanilla 3.4.0 and R 3.3.2 both on macOS Sierra 10.12.1). This problem is may be related only to `sav` files. I got no errors for reading `sas7bdat` files.\r\n\r\n**EDIT**: I tested on `Windows 7 x64 (build 7601) Service Pack 1`  with `R 3.3.2` and got the same error. \r\n```\r\n> library(haven)\r\n> unzip('BKL_oferty_pracy_1ed.sav.zip')\r\n> dt <- read_spss('BKL_oferty_pracy_1ed.sav')\r\nBłąd w poleceniu 'df_parse_sav_file(spec, user_na)':\r\n  Failed to parse BKL_oferty_pracy_1ed.sav: Unable to allocate memory.\r\n> traceback()\r\n5: stop(list(message = \"Failed to parse BKL_oferty_pracy_1ed.sav: Unable to allocate memory.\", \r\n       call = df_parse_sav_file(spec, user_na), cppstack = list(\r\n           file = \"\", line = -1L, stack = c(\"1   haven.so                            0x000000010c588fc4 _ZN4Rcpp9exceptionC2EPKcb + 276\", \r\n           \"2   haven.so                            0x000000010c58b523 _ZN4Rcpp4stopIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcEEEvS9_DpOT_ + 83\", \r\n           \"3   haven.so                            0x000000010c5847a1 _Z13df_parse_spssI17DfReaderInputFileEN4Rcpp6VectorILi19ENS1_15PreserveStorageEEES4_bb + 833\", \r\n           \"4   haven.so                            0x000000010c5843fe _Z17df_parse_sav_fileN4Rcpp6VectorILi19ENS_15PreserveStorageEEEb + 46\", \r\n           \"5   haven.so                            0x000000010c596054 _haven_df_parse_sav_file + 148\", \r\n           \"6   libR.dylib                          0x0000000109525bb3 do_dotcall + 387\", \r\n           \"7   libR.dylib                          0x000000010955788f Rf_eval + 1823\", \r\n           \"8   libR.dylib                          0x00000001095976ab do_begin + 475\", \r\n           \"9   libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"10  libR.dylib                          0x00000001095954f6 R_execClosure + 870\", \r\n           \"11  libR.dylib                          0x000000010955770f Rf_eval + 1439\", \r\n           \"12  libR.dylib                          0x00000001094e153e do_switch + 1502\", \r\n           \"13  libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"14  libR.dylib                          0x00000001095976ab do_begin + 475\", \r\n           \"15  libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"16  libR.dylib                          0x00000001095954f6 R_execClosure + 870\", \r\n           \"17  libR.dylib                          0x000000010955770f Rf_eval + 1439\", \r\n           \"18  libR.dylib                          0x00000001094e153e do_switch + 1502\", \r\n           \"19  libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"20  libR.dylib                          0x00000001095976ab do_begin + 475\", \r\n           \"21  libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"22  libR.dylib                          0x00000001095954f6 R_execClosure + 870\", \r\n           \"23  libR.dylib                          0x000000010955770f Rf_eval + 1439\", \r\n           \"24  libR.dylib                          0x0000000109597b79 do_set + 153\", \r\n           \"25  libR.dylib                          0x0000000109557571 Rf_eval + 1025\", \r\n           \"26  libR.dylib                          0x00000001095ce128 Rf_ReplIteration + 792\", \r\n           \"27  libR.dylib                          0x00000001095cf725 R_ReplConsole + 149\", \r\n           \"28  libR.dylib                          0x00000001095cf652 run_Rmainloop + 82\", \r\n           \"29  R                                   0x00000001094a1f5b main + 27\", \r\n           \"30  libdyld.dylib                       0x00007fffc488d255 start + 1\", \r\n           \"31  ???                                 0x0000000000000001 0x0 + 1\"\r\n           ))))\r\n4: .Call(`_haven_df_parse_sav_file`, spec, user_na)\r\n3: df_parse_sav_file(spec, user_na)\r\n2: read_sav(file, user_na = user_na)\r\n1: read_spss(\"BKL_oferty_pracy_1ed.sav\")\r\n```\r\n\r\nSessionInfo \r\n\r\n```\r\n> sessionInfo()\r\nR version 3.4.0 (2017-04-21)\r\nPlatform: x86_64-apple-darwin15.6.0 (64-bit)\r\nRunning under: macOS Sierra 10.12.1\r\n\r\nMatrix products: default\r\nBLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib\r\nLAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib\r\n\r\nlocale:\r\n[1] C/UTF-8/C/C/C/C\r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] haven_1.1.1\r\n\r\nloaded via a namespace (and not attached):\r\n [1] readr_1.1.1      compiler_3.4.0   R6_2.2.2         magrittr_1.5    \r\n [5] RevoUtils_10.0.4 hms_0.4.0        tools_3.4.0      pillar_1.1.0    \r\n [9] tibble_1.4.2     Rcpp_0.12.15     forcats_0.2.0    pkgconfig_2.0.1 \r\n[13] rlang_0.1.6  \r\n```\r\n\r\nAlso tested on\r\n\r\n```\r\n> sessionInfo()\r\nR version 3.3.2 (2016-10-31)\r\nPlatform: x86_64-apple-darwin11.4.2 (64-bit)\r\nRunning under: macOS Sierra 10.12.1\r\n\r\nlocale:\r\n[1] en_US/UTF-8/en_US/C/en_US/en_US\r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] haven_1.1.1\r\n\r\nloaded via a namespace (and not attached):\r\n[1] readr_1.1.1   R6_2.2.0      magrittr_1.5  hms_0.3       tools_3.3.2  \r\n[6] tibble_1.3.1  Rcpp_0.12.11  forcats_0.2.0 rlang_0.1.1 \r\n```\r\n\r\nEDIT: Windows machine\r\n\r\n```\r\nR version 3.3.2 (2016-10-31)\r\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\r\nRunning under: Windows 7 x64 (build 7601) Service Pack 1\r\n\r\nlocale:\r\n[1] LC_COLLATE=Polish_Poland.1250  LC_CTYPE=Polish_Poland.1250    LC_MONETARY=Polish_Poland.1250\r\n[4] LC_NUMERIC=C                   LC_TIME=Polish_Poland.1250    \r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] haven_1.1.1\r\n\r\nloaded via a namespace (and not attached):\r\n [1] readr_1.1.1     R6_2.2.2        magrittr_1.5    hms_0.4.0       tools_3.3.2     pillar_1.1.0   \r\n [7] tibble_1.4.2    Rcpp_0.12.15    forcats_0.2.0   pkgconfig_2.0.1 rlang_0.1.6 \r\n```\r\n\r\n```\r\n> dane <- read_spss(BKL_oferty_pracy_1ed.sav)\r\nError in df_parse_sav_file(spec, user_na) : \r\n  Failed to parse BKL_oferty_pracy_1ed.sav: Unable to allocate memory.\r\n> traceback()\r\n5: stop(list(message = \"Failed to parse BKL_oferty_pracy_1ed.sav: Unable to allocate memory.\", \r\n       call = df_parse_sav_file(spec, user_na), cppstack = list(\r\n           file = \"\", line = -1L, stack = \"C++ stack not available on this system\")))\r\n4: .Call(`_haven_df_parse_sav_file`, spec, user_na)\r\n3: df_parse_sav_file(spec, user_na)\r\n2: read_sav(file, user_na = user_na)\r\n1: read_spss(fname)\r\n```"},"comment":{"url":"https://api.github.com/repos/tidyverse/haven/issues/comments/362577607","html_url":"https://github.com/tidyverse/haven/issues/342#issuecomment-362577607","issue_url":"https://api.github.com/repos/tidyverse/haven/issues/342","id":362577607,"user":{"login":"maxwell8888","id":28952593,"avatar_url":"https://avatars1.githubusercontent.com/u/28952593?v=4","gravatar_id":"","url":"https://api.github.com/users/maxwell8888","html_url":"https://github.com/maxwell8888","followers_url":"https://api.github.com/users/maxwell8888/followers","following_url":"https://api.github.com/users/maxwell8888/following{/other_user}","gists_url":"https://api.github.com/users/maxwell8888/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwell8888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwell8888/subscriptions","organizations_url":"https://api.github.com/users/maxwell8888/orgs","repos_url":"https://api.github.com/users/maxwell8888/repos","events_url":"https://api.github.com/users/maxwell8888/events{/privacy}","received_events_url":"https://api.github.com/users/maxwell8888/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T12:48:54Z","updated_at":"2018-02-02T12:48:54Z","author_association":"NONE","body":"Use this to revert to previous working version:\r\nremove.packages(\"haven\")\r\ndevtools::install_version(\"haven\", version = \"1.1.0\", repos = \"http://cran.us.r-project.org\")\r\n"}}
{"actor":{"display_login":"maxwell8888"}}