Skip to content

Conversation

@aitap
Copy link
Member

@aitap aitap commented Jan 19, 2026

This will avoid name clashes between data.table functions (now hidden) and other functions in the global namespace visible to the shared library loader.

Tested on R-4.2/Linux, R-3.5/Windows.

Fixes: #7605

This will avoid name clashes between data.table functions (now hidden)
and other functions in the global namespace visible to the shared
library loader.

Fixes: #7605
@aitap aitap requested a review from MichaelChirico as a code owner January 19, 2026 18:34
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.01%. Comparing base (35dbf06) to head (1ecbe92).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7607   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files          87       87           
  Lines       16896    16896           
=======================================
  Hits        16730    16730           
  Misses        166      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

  • HEAD=visibility-hidden slower P<0.001 for memrecycle regression fixed in #5463
    Comparison Plot

Generated via commit 1ecbe92

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 5 minutes and 26 seconds
Installing different package versions 11 minutes and 7 seconds
Running and plotting the test cases 4 minutes and 6 seconds

@TysonStanley
Copy link
Member

Looks like once this is merged and cherry-picked into the patch, we can submit 1.18.2. Thanks @aitap for getting a fix so quickly that we can include it in this submission.

@MichaelChirico
Copy link
Member

MichaelChirico commented Jan 20, 2026

Great! TIL about the win.def thing -- it's common elsewhere on CRAN though:

https://github.com/search?q=org%3Acran%20path%3A%2Fwin%5C.def%2F&type=code

Would you say it's worth reporting to other maintainers if they have visibility restricted but don't have this file?

e.g. {xml2}: r-lib/xml2@1ffdce4

@MichaelChirico MichaelChirico merged commit d6ac127 into master Jan 20, 2026
13 checks passed
@MichaelChirico MichaelChirico deleted the visibility-hidden branch January 20, 2026 06:47
@aitap
Copy link
Member Author

aitap commented Jan 20, 2026

I don't know whether the same problem is possible on Windows. On Linux (and other Unix-likes) a DLL can be linked with missing symbols and resolve them from the main process (or other DLLs) when it's loaded. That's how R works when compiled without --enable-R-shlib (and how LD_PRELOAD tricks work). On Windows linking is more explicit, specifying which DLL every symbol is imported from, so it should be much harder to link to the wrong function by accident.

Still, they do export all these functions on Windows:

$ /x86_64-w64-mingw32.static.posix/bin/objdump.exe -p R-4.5.1/library/xml2/libs/x64/xml2.dll
R-4.5.1/library/xml2/libs/x64/xml2.dll:     file format pei-x86-64
...
[Ordinal/Name Pointer] Table
        [   0] R_init_xml2
        [   1] _Z11getNodeTypeP7SEXPREC
        [   2] _Z14node_attr_implP7SEXPRECRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES0_S0_
        [   3] _Z14node_name_implP7SEXPRECS0_
        [   4] _Z14node_path_implP7SEXPREC
        [   5] _Z14node_text_implP7SEXPREC
        [   6] _Z14node_type_implP7SEXPREC
        [   7] _Z15cache_namespaceP8_xmlNodeP5NsMap
        [   8] _Z15node_attrs_implP7SEXPRECS0_
        [   9] _Z15xmlAddNamespaceP8_xmlNodeP6_xmlNs
        [  10] _Z15xmlNsDefinitionP8_xmlNodePKh
...

(95 in total)

It wouldn't hurt to hide them.

@aitap aitap added this to the 1.18.2 milestone Jan 20, 2026
aitap added a commit that referenced this pull request Jan 20, 2026
This will avoid name clashes between data.table functions (now hidden)
and other functions in the global namespace visible to the shared
library loader.

Fixes: #7605
aitap added a commit that referenced this pull request Jan 20, 2026
@aitap aitap mentioned this pull request Jan 20, 2026
aitap added a commit that referenced this pull request Jan 20, 2026
* NEWS entry for #7607

* More about the problem being solved

Co-Authored-By: Benjamin Schwendinger <[email protected]>
aitap added a commit that referenced this pull request Jan 20, 2026
* NEWS entry for #7607

* More about the problem being solved

Co-Authored-By: Benjamin Schwendinger <[email protected]>
This was referenced Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data.table 1.18.0 causes Postgresql server crash (segmentation fault) with pl/R on Debian servers

3 participants