FS#59581 - R package install crashes with gcc / glibc updates

Attached to Project: Arch Linux
Opened by M. Edward (Ed) Borasky (znmeb) - Wednesday, 08 August 2018, 23:03 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 09 August 2018, 07:00 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: R package installs crash with

terminate called after throwing an instance of 'std::runtime_error'
what(): Mutex creation failed

after upgrading to gcc-8.2.0 and glibc 2.28. Downgrading makes R package installs work but then the GNOME desktop no longer comes up!

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
1. Upgrade to latest system, including r-3.5.1-2
2. Start R.
3. At the ">" prompt, type "install.packages("learnr")

This task depends upon

Closed by  Eli Schwartz (eschwartz)
Thursday, 09 August 2018, 07:00 GMT
Reason for closing:  Upstream
Additional comments about closing:  seems like this will be solved by individual projects implementing glibc 2.28 support, none of which we package in our repos
Comment by M. Edward (Ed) Borasky (znmeb) - Wednesday, 08 August 2018, 23:09 GMT
See https://bugs.archlinux.org/task/59550, https://github.com/r-lib/later/issues/45, and https://github.com/r-lib/later/issues/63. This may be upstream; I tried rebuilding R from source and it showed the same symptoms. I'm going to retry that before closing this as upstream though.
Comment by Eli Schwartz (eschwartz) - Thursday, 09 August 2018, 01:54 GMT
Not the same issue. The other bug doesn't seem to manifest for me at all, and it was a compiler error. This here is compiling just fine, but when R runs its self-test it discovers that the resulting compiled code doesn't actually work.
Comment by Eli Schwartz (eschwartz) - Thursday, 09 August 2018, 01:56 GMT
For the record:

> install.packages("later")

...
gcc -I"/usr/include/R/" -DNDEBUG -pthread -I"/build/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I"/build/R/x86_64-pc-linux-gnu-library/3.5/BH/include" -D_FORTIFY_SOURCE=2 -fpic -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -c tinycthread.c -o tinycthread.o
g++ -shared -L/usr/lib64/R/lib -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o later.so RcppExports.o callback_registry.o init.o later.o later_native.o later_posix.o later_win32.o timer_posix.o timestamp_unix.o timestamp_win32.o tinycthread.o -pthread -L/usr/lib64/R/lib -lR
installing to /build/R/x86_64-pc-linux-gnu-library/3.5/later/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
sh: line 1: 154 Aborted (core dumped) '/usr/lib64/R/bin/R' --no-save --slave 2>&1 < '/tmp/RtmpMqWXCT/file7172600384'
terminate called after throwing an instance of 'std::runtime_error'
what(): Mutex creation failed
ERROR: loading failed
* removing ‘/build/R/x86_64-pc-linux-gnu-library/3.5/later’
Comment by Eli Schwartz (eschwartz) - Thursday, 09 August 2018, 01:59 GMT
As mentioned in https://github.com/r-lib/later/issues/45#issuecomment-411591399 this might be due to the package in question doing bad things with pthread.
Comment by M. Edward (Ed) Borasky (znmeb) - Thursday, 09 August 2018, 02:16 GMT
There are several R packages that fail with the same symptom - I'm compiling a list at the moment to see if they all do the same thread things.
Comment by Allan McRae (Allan) - Thursday, 09 August 2018, 05:20 GMT
Looks like a function name clash. glibc implemented ISO C threads in 2.28 and that mtx_init is being called rather than the R library provided version. Probably worked around with a sed on the R sources. Nothing to be done at the Arch end.
Comment by M. Edward (Ed) Borasky (znmeb) - Thursday, 09 August 2018, 06:20 GMT
Yep - there are quite a few R packages running into this, it turns out. You can probably close this out as "upstream issue". There are at least three R packages on GitHub that hit this - if you need issue links, let me know. I filed two of them. ;-)

Loading...