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

Windows: a garbage character is sometimes placed at the end of 'fluentdopt' registry value (fluent-package) #619

Closed
daipom opened this issue Feb 16, 2024 · 2 comments
Labels

Comments

@daipom
Copy link
Contributor

daipom commented Feb 16, 2024

Abst

  • A garbage character is sometimes placed at the end of fluentdopt registry value
  • There is NO problem with Fluentd's behavior
  • This is the bug of Ruby, and it has been fixed since Ruby 3.2.3

Details

I feel like 100 characters would be easy to reproduce.
(I am not sure if the number of characters really has anything to do with the ease of reproduction.)

> fluentd --reg-winsvc-fluentdopt aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

2024-02-16_12h09_16

Confirm the value:

 require "win32/registry"
 
 Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\fluentdwinsvc") do |reg|
   p reg.read("fluentdopt")[1] # A
   type, data = Win32::Registry::API.QueryValue(reg.hkey, "fluentdopt")
   p data.encode(Encoding::UTF_8, Encoding::UTF_16LE) # B
   p data.encode(Encoding::UTF_8, Encoding::UTF_16LE).bytes #C
 end

A:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

B:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaꘀ"

C:[97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 234, 152, 128]

The garbage character can be different.

@ashie
Copy link
Member

ashie commented Feb 28, 2024

We confirmed that it's completely harmless because:

  * However, it does not impact the Fluentd's behavior since [Ruby chops the character regardless of the content](https://github.com/ruby/ruby/blob/v3_2_2/ext/win32/lib/win32/registry.rb#L652)

We suspected it might be the cause of #618, but we've confirmed that it's not applicable too.
So we no longer need to track this issue.

@ashie ashie closed this as completed Feb 28, 2024
@daipom
Copy link
Contributor Author

daipom commented Feb 28, 2024

Agreed.
It will be fixed when updating the Ruby.
We don't need to track this issue.

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