Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.dynLibs() is wiped out, probably in a finalizer #176

Closed
gaborcsardi opened this issue Nov 17, 2021 · 0 comments · Fixed by #200
Closed

.dynLibs() is wiped out, probably in a finalizer #176

gaborcsardi opened this issue Nov 17, 2021 · 0 comments · Fixed by #200
Labels
bug an unexpected problem or unintended behavior

Comments

@gaborcsardi
Copy link
Member

See this minimal package: https://github.com/gaborcsardi/empty

wipe.R has:

.dynLibs()
pkgload::load_all()
.dynLibs()
gc()
.dynLibs()
pkgload::load_all()
.dynLibs()
gc()
.dynLibs()

If you run this, notice how the last .dynLibs() is an empty list:

❯ R --vanilla -q -f wipe.R
> .dynLibs()
                                                                                          Filename
1     /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/methods/libs/methods.so
2         /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/utils/libs/utils.so
3 /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/grDevices/libs/grDevices.so
4   /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/graphics/libs/graphics.so
5         /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/stats/libs/stats.so
  Dynamic.Lookup
1          FALSE
2          FALSE
3          FALSE
4          FALSE
5          FALSE

[...]

> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 518020 27.7     943277 50.4         NA   943277 50.4
Vcells 908323  7.0    8388608 64.0      16384  1824252 14.0
> .dynLibs()
>

Session info:

❯ sessioninfo::session_info(pkgs="pkgload")
─ Session info  ✍️  🇧🇳  😙   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 hash: writing hand, flag: Brunei, kissing face with smiling eyes

 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       macOS Monterey 12.0.1
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Madrid
 date     2021-11-17
 pandoc   2.16.1 @ /opt/homebrew/bin/pandoc

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package    * version    date (UTC) lib source
 cli          3.1.0      2021-10-27 [1] CRAN (R 4.1.1)
 crayon       1.4.2      2021-10-29 [1] CRAN (R 4.1.1)
 desc         1.4.0      2021-09-28 [1] CRAN (R 4.1.1)
 glue         1.5.0      2021-11-07 [1] CRAN (R 4.1.1)
 pkgload      1.2.3.9000 2021-11-17 [1] local
 R6           2.5.1      2021-08-19 [1] CRAN (R 4.1.1)
 rlang        0.4.12     2021-10-18 [1] CRAN (R 4.1.1)
 rprojroot    2.0.2      2020-11-15 [1] CRAN (R 4.1.0)
 rstudioapi   0.13       2020-11-12 [1] CRAN (R 4.1.0)
 withr        2.4.2      2021-04-18 [1] CRAN (R 4.1.1)

 [1] /Users/gaborcsardi/Library/R/arm64/4.1/library
 [2] /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant