HenrikBengtsson / future

:rocket: R package: future: Unified Parallel and Distributed Processing in R for Everyone
https://future.futureverse.org
949 stars 83 forks source link

Startup access to uuid breaks package load and hence install #740

Closed eddelbuettel closed 2 hours ago

eddelbuettel commented 2 hours ago

Describe the bug

The package cannot install (or load, hence breaking install of reverse dependencies, here mlr3) as it dies on *** buffer overflow detected ***: terminated

Reproduce example

At least on my system:

$ Rscript -e 'install.packages("future")'

There is clearly something else going on but I do not know what. Ubuntu 24.04, very vanilla, lots of other packages installed, no unusual environment variables.

Expected behavior

Being able to do library(future)

Session information

> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8      
 [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Chicago
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.4.1 tools_4.4.1    parallel_4.4.1 colorout_1.3-1 fortunes_1.5-4
> 
>
> future::futureSessionInfo()
*** Package versions
future 1.34.0, parallelly 1.38.0, parallel 4.4.1, globals 0.16.3, listenv 0.9.1

*** Allocations
availableCores():
  system    nproc mc.cores 
      12       12       12 
availableWorkers():
$mc.cores
 [1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

$nproc
 [1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

$system
 [1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

*** Settings
- future.plan=<not set>
- future.fork.multithreading.enable=<not set>
- future.globals.maxSize=<not set>
- future.globals.onReference=<not set>
- future.resolve.recursive=<not set>
- future.rng.onMisuse=<not set>
- future.wait.timeout=<not set>
- future.wait.interval=<not set>
- future.wait.alpha=<not set>
- future.startup.script=<not set>

*** Backends
Number of workers: 1
List of future strategies:
1. sequential:
   - args: function (..., envir = parent.frame(), workers = "<NULL>")
   - tweaked: FALSE
   - call: NULL

*** Basic tests
Main R session details:
      pid     r sysname          release                                                     version nodename machine   login    user effective_user
1 3333057 4.4.1   Linux 6.8.0-38-generic #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun  7 15:25:01 UTC 2024  host001  x86_64 user001 user001        user001
*** buffer overflow detected ***: terminated
Aborted (core dumped)
edd@rob:~/git/future(develop)$ 
eddelbuettel commented 2 hours ago

By trial and error I was able to have it install with this diff which avoids the buffer overflow:

modified   R/zzz.R
@@ -20,7 +20,7 @@

   ## Initiate the R session UUID, which will also set/update
   ## .GlobalEnv$.Random.seed.
-  session_uuid(attributes = FALSE)
+  #session_uuid(attributes = FALSE)

   ## Report on future plan, if set
@@ -58,7 +58,7 @@
   }

   ## Create UUID for this process
-  id <- session_uuid()
+  #id <- session_uuid()

   if (debug) {
     mdebugf("R process uuid: %s", id)
eddelbuettel commented 2 hours ago

Ah never mind it was of course ... all me. We are doing current work on digest and my local dev version borked it.

With digest from CRAN, future installs fine (as one would expect) and then so does mlr3. All good.