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

Investigate missing counter names on RubyInstaller #10

Open
fujimotos opened this issue Dec 15, 2021 · 6 comments
Open

Investigate missing counter names on RubyInstaller #10

fujimotos opened this issue Dec 15, 2021 · 6 comments
Labels

Comments

@fujimotos
Copy link
Collaborator

fujimotos commented Dec 15, 2021

Branched from #1 (comment).

  • When we query HKEY_PERFORMANCE_DATA for counter names, some entries are missing from the data.
  • It only occurs when we we run it on Ruby.
  • Other languages (C and Python) do not have the same problem.
@fujimotos
Copy link
Collaborator Author

@daipom's investigation revealed that the root cause was SetDefaultDllDirectories().
If we do not call that function, it works as expected:

We've found the cause.
When SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS) is executed,
some data cannot be retrieved in both ruby and C++.
SetDefaultDllDirectories: https://docs.microsoft.com/ja-jp/windows/win32/api/libloaderapi/nf-libloaderapi-setdefaultdlldirectories

In ruby, this is called by RubyInstaller::Runtime.enable_dll_search_paths in rubygems\defaults\operating_system.rb.
(In my machine, the path is C:\Ruby26-x64\lib\ruby\2.6.0\rubygems\defaults\operating_system.rb)
Commenting out this fixes this problem in ruby.

In C++, adding SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); makes the same problem
occur.

@daipom
Copy link
Contributor

daipom commented Dec 15, 2021

@fujimotos Thank you for re-summarizing this!

@fujimotos
Copy link
Collaborator Author

fujimotos commented Dec 15, 2021

@daipom FWIW, I don't think we resolve this issue (at least) in the first release.

It strongly seems to me that it's essentially caused by the way RubyInstaller sets up
the execution environment, not by some deficit in our implementation.

But anyway, I created a separate ticket for the issue, mostly because I wanted to
make it easier to track our investigtion progress.

@fujimotos
Copy link
Collaborator Author

A possible related issue: oneclick/rubyinstaller2#243

@daipom
Copy link
Contributor

daipom commented Dec 15, 2021

I agree! Thank you!

@fujimotos
Copy link
Collaborator Author

I stated to label any non-critical tickets as longterm. These tickets are not
necessary for our first release, so we don't need to work on them at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants