[Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()

Gábor Csárdi c@@rd|@g@bor @end|ng |rom gm@||@com
Sat Jan 11 15:09:39 CET 2020


On Sat, Jan 11, 2020 at 12:53 PM Simon Urbanek
<simon.urbanek using r-project.org> wrote:
[...]
> > I think it works now, because Apple switched to a different SSL
> > library for libcurl. It usually crashes or fails on older macOS
> > versions, with the CRAN build of R as well.
> >
>
> That is not true - Apple has not changed the SSL back-end for many years. The issue in that post is presumably in the homebrew version of SSL.

This is CRAN R 3.6.2 on El Capitan crashing for HTTPS. Homebrew is not
installed on the machine.

> download.file("https://httpbin.org/status/200", tempfile(), method = "libcurl")
trying URL 'https://httpbin.org/status/200'
downloaded 0 bytes

> parallel::mclapply(1:10, function(x) download.file("https://httpbin.org/status/200", tempfile(), method = "libcurl"))
trying URL 'https://httpbin.org/status/200'
trying URL 'https://httpbin.org/status/200'

 *** caught segfault ***

address 0x110, cause 'memory not mapped'

I assume the crash is coming from the SSL library/ies because it does
work for HTTP, only crashes for HTTPS.

FWIW these are the libraries the system libcurl uses on El Capitan:

Rhubs-Mac-3:macoscheck rhub$ otool -L /usr/lib/libcurl.4.dylib
/usr/lib/libcurl.4.dylib:
     /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current
version 8.0.0)
     /System/Library/Frameworks/Security.framework/Versions/A/Security
(compatibility version 1.0.0, current version 57332.0.0)
     /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 1231.0.0)
     /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
(compatibility version 1.0.0, current version 2.4.0)
     /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
(compatibility version 5.0.0, current version 6.0.0)
     /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1225.0.0)

and this is Mojave:

❯ otool -L /usr/lib/libcurl.4.dylib
/usr/lib/libcurl.4.dylib:
     /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current
version 9.0.0)
     /usr/lib/libcrypto.42.dylib (compatibility version 43.0.0,
current version 43.0.0)
     /usr/lib/libssl.44.dylib (compatibility version 45.0.0, current
version 45.1.0)
     /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
(compatibility version 1.0.0, current version 2.4.0)
     /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
(compatibility version 5.0.0, current version 6.0.0)
     /usr/lib/libapple_nghttp2.dylib (compatibility version 1.0.0,
current version 1.24.1)
     /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1252.250.1)

So the SSL libs do look different to me, but please FIXME. Relatedly,
on El Capitan an HTTPS download with download.file() starts up extra
threads, whereas on Mojave it does not.

Gabor

> Cheers,
> Simon
[...]



More information about the R-devel mailing list