From c@@rd|@g@bor @end|ng |rom gm@||@com  Sat Jan 11 15:09:39 2020
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Sat, 11 Jan 2020 14:09:39 +0000
Subject: [Rd] SUGGESTION: Settings to disable forked processing in R,
 e.g. parallel::mclapply()
In-Reply-To: <51292B2D-56D6-44B5-B64A-78408C452503@R-project.org>
References: <84d162f5-dd0d-64e6-e9bf-54b65a10faa6@gmail.com>
 <DCF5422D-5237-48C1-BE51-486CA3C1DD60@r-project.org>
 <CAFDcVCS0RwA0-64FTY6kiOk6=yxy8w4OweVbESa-3G6JHtV6Xg@mail.gmail.com>
 <6D7F010F-60B4-4C51-99B3-D8B51BE7572A@R-project.org>
 <CABtg=Km4GdMC5vGOs0PqvOjqABqcrhOZOqPv=81DuoX75zm8HQ@mail.gmail.com>
 <51292B2D-56D6-44B5-B64A-78408C452503@R-project.org>
Message-ID: <CABtg=KkTjF4YCmmQ68D=cOVYK9k6vB2o-Zrx_d3=6dRs--VY3g@mail.gmail.com>

On Sat, Jan 11, 2020 at 12:53 PM Simon Urbanek
<simon.urbanek at 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
[...]



[Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=