-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Bug with DeviceIoControl function call on Windows #16553
Conversation
diskPerformance is not same size as DISK_PERFORMANCE in WinAPI code. In general members order and size is correct, but GoLang is not including structure alignment. Due to this calls of DeviceIoControl in ioCounter are always failing with error "The parameter is incorrect". Fix is to add in the end of structure missing alignment bytes. In WinAPI code, structure is aligned base on biggest size member. This is LARGE_INTEGER(8 bytes), order of members allows to perform alignment only once, in the end of structure. Sum of all members sizes is 84 bytes, therefore to be aligned structure needs additional 4 bytes.
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
hi @yaroslavmamrokha , I have been having a hard time reproducing this issue, tested on windows 10 (64 bit), Windows Server 2016 (64 bit) and Windows Server 2012 (32 bit).
|
Hi @narph , my apologize... I've double checked and seems like its x32 only issue. When I've been building x32 project I forgot to change afterwards GOARCH to amd64, and therefore both x32 and x64 Windows was working with x32 app. This need x32 build Here is sample of code that i've generated from your source, that is failing: and here same code but x64 version: Attaching code snipped. As for questions:
|
hi @yaroslavmamrokha , thanks for getting back and confirming, I will close the PR, if you have any questions feel free to reach out. |
Hi @narph, |
@yaroslavmamrokha , I think I misread your previous reply. |
Hi @narph |
What does this PR do?
PR is fixing issue with DISKIO ioCounter function, as it is constantly failing with error "The parameter is incorrect" during DeviceIoControl call on Windows environment.
Issue is reproducible on both Windows 7/ Windows 10 x32 Other Windows platforms are not tested.
Changed:
Why is it important?
Currently DiskIO functionality for ioCounter is not working, and produce a lot of errors during run.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [] I have added tests that prove my fix is effective or that my feature worksAuthor's Checklist
How to test this PR locally
Run metricbeats service and configure it to get DiskIO counters. Check if no error occurs and returned data is valid
Related issues
Use cases
Screenshots
Logs