Code Monkey home page Code Monkey logo

Comments (12)

adamhsparks avatar adamhsparks commented on June 26, 2024

I've had the same issue now trying to use devtools::check_win_devel() from a regular R session in my terminal, R segfaulted when the package was to be uploaded.

from curl.

jeroen avatar jeroen commented on June 26, 2024

Did this start happening after you upgraded to Sonoma 14.5 ? What is the curl_version() on your system?

Could you test if the problem goes away if you install the curl package from source, and then restart R?

install.packages("curl", type = "source")

from curl.

adamhsparks avatar adamhsparks commented on June 26, 2024

Yes, AFAIK it's related to the upgrade to 14.5 but I can't prove it.

I've tried building from source as well using the system version and the Homebrew version of curl to build from source but get the same result. That was the first thing I tried.

Here's the Homebrew version that's installed.

> curl -V
curl 8.7.1 (aarch64-apple-darwin23.4.0) libcurl/8.7.1 (SecureTransport) OpenSSL/3.3.0 zlib/1.2.12 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libssh2/1.11.0 nghttp2/1.61.0 librtmp/2.3 OpenLDAP/2.6.7
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

Here's what's reported for the system curl version that's installed.

❯ curl -V
curl 8.6.0 (x86_64-apple-darwin23.0) libcurl/8.6.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Release-Date: 2024-01-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets

from curl.

lcolladotor avatar lcolladotor commented on June 26, 2024

Hi,

I just re-opened Bioconductor/BiocFileCache#48 which I had linked at #232 (comment), and was initially resolved by upgrading my macOS from Ventura 13.4 to 13.5.

As @adamhsparks, I also just updated my Apple M1 Max to macOS Sonoma 14.5 and started running into issues.

If it helps, here's the system version of curl installed.

 % curl -V
curl 8.6.0 (x86_64-apple-darwin23.0) libcurl/8.6.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Release-Date: 2024-01-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets

As I reported at Bioconductor/BiocFileCache#48 (comment), I've also tried it with R 4.4.0 and install.packages("curl", type = "source").

At Bioconductor/BiocFileCache#48 (comment), I show that with utils::download.file(), things do work. Also curl::curl_download() and httr::GET() do seem to work as noted at Bioconductor/BiocFileCache#48 (comment) and Bioconductor/BiocFileCache#48 (comment), respectively.

I posted this info on the odd chance that our issues were related and/or help identify the source of issues.

Best,
Leo

from curl.

lcolladotor avatar lcolladotor commented on June 26, 2024

Hi again,

Thanks to @mtmorgan at Bioconductor/BiocFileCache#48 (comment), I got to a smaller reproducible example for my case just using httr::HEAD(). As noted on that other thread, httr::HEAD() does work on a linux OS machine I have access to.

Here's the traceback output:

> httr::HEAD("http://www.dropbox.com/s/srkb2ife75px2yz/modeling_results_BayesSpace_k09.Rdata?dl=1")
Error in curl::curl_fetch_memory(url, handle = handle) :
  HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
> traceback()
5: curl::curl_fetch_memory(url, handle = handle)
4: request_fetch.write_memory(req$output, req$url, handle)
3: request_fetch(req$output, req$url, handle)
2: request_perform(req, hu$handle$handle)
1: httr::HEAD("http://www.dropbox.com/s/srkb2ife75px2yz/modeling_results_BayesSpace_k09.Rdata?dl=1")

Here's the longer reprex::reprex() output on macOS Sonoma 14.5:

httr::HEAD("http://www.dropbox.com/s/srkb2ife75px2yz/modeling_results_BayesSpace_k09.Rdata?dl=1")
#> Error in curl::curl_fetch_memory(url, handle = handle): HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
options(width = 120)
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.0 (2024-04-24)
#>  os       macOS Sonoma 14.5
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/New_York
#>  date     2024-05-20
#>  pandoc   3.1.12.1 @ /opt/homebrew/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  cli           3.6.2   2023-12-11 [1] CRAN (R 4.4.0)
#>  curl          5.2.1   2024-03-01 [1] CRAN (R 4.4.0)
#>  digest        0.6.35  2024-03-11 [1] CRAN (R 4.4.0)
#>  evaluate      0.23    2023-11-01 [1] CRAN (R 4.4.0)
#>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.0)
#>  fs            1.6.4   2024-04-25 [1] CRAN (R 4.4.0)
#>  glue          1.7.0   2024-01-09 [1] CRAN (R 4.4.0)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
#>  httr          1.4.7   2023-08-15 [1] CRAN (R 4.4.0)
#>  knitr         1.46    2024-04-06 [1] CRAN (R 4.4.0)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.0)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.4.0)
#>  purrr         1.0.2   2023-08-10 [1] CRAN (R 4.4.0)
#>  R.cache       0.16.0  2022-07-21 [1] CRAN (R 4.4.0)
#>  R.methodsS3   1.8.2   2022-06-13 [1] CRAN (R 4.4.0)
#>  R.oo          1.26.0  2024-01-24 [1] CRAN (R 4.4.0)
#>  R.utils       2.12.3  2023-11-18 [1] CRAN (R 4.4.0)
#>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.4.0)
#>  reprex        2.1.0   2024-01-11 [1] CRAN (R 4.4.0)
#>  rlang         1.1.3   2024-01-10 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.27    2024-05-17 [1] CRAN (R 4.4.0)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.0)
#>  styler        1.10.3  2024-04-07 [1] CRAN (R 4.4.0)
#>  vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.4.0)
#>  withr         3.0.0   2024-01-16 [1] CRAN (R 4.4.0)
#>  xfun          0.44    2024-05-15 [1] CRAN (R 4.4.0)
#>  yaml          2.3.8   2023-12-11 [1] CRAN (R 4.4.0)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
curl::curl_version()
#> $version
#> [1] "8.6.0"
#> 
#> $ssl_version
#> [1] "(SecureTransport) LibreSSL/3.3.6"
#> 
#> $libz_version
#> [1] "1.2.12"
#> 
#> $libssh_version
#> [1] NA
#> 
#> $libidn_version
#> [1] NA
#> 
#> $host
#> [1] "x86_64-apple-darwin23.0"
#> 
#> $protocols
#>  [1] "dict"    "file"    "ftp"     "ftps"    "gopher"  "gophers" "http"    "https"   "imap"    "imaps"   "ldap"   
#> [12] "ldaps"   "mqtt"    "pop3"    "pop3s"   "rtsp"    "smb"     "smbs"    "smtp"    "smtps"   "telnet"  "tftp"   
#> 
#> $ipv6
#> [1] TRUE
#> 
#> $http2
#> [1] TRUE
#> 
#> $idn
#> [1] FALSE

Created on 2024-05-20 with reprex v2.1.0

Best,
Leo

from curl.

jeroen avatar jeroen commented on June 26, 2024

@lcolladotor I think these may be 2 different issues in recent libcurl actually 😞 . Thanks for the reproducer, that will make it easier to diagnose your problem.

from curl.

lcolladotor avatar lcolladotor commented on June 26, 2024

I see 😔. Well, it was worth a shot. Thanks for posting curl/curl#13725 already (which is the root issue for the problem I reported).

Good luck tracing the issue Adam reported!

And thanks again for maintaining curl and httr and all these great packages!!!! ^^

from curl.

jeroen avatar jeroen commented on June 26, 2024

Supposedly, both issues are resolved in libcurl 8.8.0.

from curl.

jeroen avatar jeroen commented on June 26, 2024

@adamhsparks IIUC your bug is triggered only via Scott's crul package. You can probably work around it by switching to httr2 or curl to do http requests.

from curl.

lcolladotor avatar lcolladotor commented on June 26, 2024

Thanks @jeroen!

I've confirmed at Bioconductor/BiocFileCache#48 (comment) that libcurl 8.8.0 resolves the issue I reported.

from curl.

adamhsparks avatar adamhsparks commented on June 26, 2024

Weird. I managed to get the same sort of error using devtools::release() when I tried to upload a package to CRAN the other day (not {weatherOz}) and I can't duplicate this with {nasapower}, which uses {crul} but it happens at different points with {weatherOz}.

I'm really not wanting to refactor the whole codebase to change the HTTP client. 😔

Gotta do what you gotta do. Thanks for looking into it.

from curl.

adamhsparks avatar adamhsparks commented on June 26, 2024

I fixed this issue. I replaced any calls to curl::curl_download() with utils::download.file() and had one curl::curl_fetch_memory(), which I refactored to use utils::download.file(). These occurrences were getting data from an FTP server where it was segfaulting when using {curl}. It's all happy now as far as I can tell and I don't have any issues with {crul}, i.e., I didn't make any changes to API calls and it's fine.

from curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.