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

[Metricbeats] Diskio is failing on DeviceIoControl function call on windows 10 IoT x32 (1809) and windows 7 Embedded x32. #16680

Closed
yaroslavmamrokha opened this issue Feb 28, 2020 · 3 comments · Fixed by #16692
Assignees
Labels
Metricbeat Metricbeat Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team

Comments

@yaroslavmamrokha
Copy link

DISKIO ioCounter function is constantly failing with error "The parameter is incorrect" during DeviceIoControl call on Windows environment.

Issue is reproducible on Windows 10 IoT x32 and Windows 7 Embedded.
This issue is related only to x32 version of metricbeat service.

To reproduce issue you need:

  • x32 build of metricbeats
  • default configuration with enabled DISKIO
  • Windows 10/7 x32 or you can check also on x64.

PR with more information in comments about issue:
#16553

@narph narph added [zube]: Investigate Metricbeat Metricbeat Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team labels Feb 28, 2020
@narph narph self-assigned this Feb 28, 2020
@zube zube bot unassigned narph Feb 28, 2020
@zube zube bot assigned narph Feb 28, 2020
@zube zube bot unassigned narph Feb 28, 2020
@zube zube bot assigned narph Feb 28, 2020
@zube zube bot unassigned narph Feb 28, 2020
@zube zube bot assigned narph Feb 28, 2020
@zube zube bot unassigned narph Feb 28, 2020
@zube zube bot assigned narph Feb 28, 2020
@zube zube bot unassigned narph Feb 28, 2020
@narph
Copy link
Contributor

narph commented Feb 28, 2020

@yaroslavmamrokha , I was able to reproduce the issue on Windows 7, 32 bit as well.
It looks like DeviceIoControl() ends up failing with ERROR_INSUFFICIENT_BUFFER (The data area passed to a system call is too small). The memory layout is indeed different for 32 bit vs 64 bit.
Adding the alignment as in your PR seemed to clear the issue.
I would suggest in this case, defining the diskPerformance struct in 2 different files ex. disk_performance_386.go (with alignment) and disk_performance_amd64.go (without alignment) so the go compiler will pick up the corresponding version depending on the CPU architecture.
Let us know if you want to open a separate PR for this, else we can help.

@yaroslavmamrokha
Copy link
Author

@narph

Great thanks, I'm not familiar with Go. I guess it's better you guys to do this, so that it could be in a valid manner. thanks!

@yaroslavmamrokha
Copy link
Author

yaroslavmamrokha commented Feb 28, 2020

@narph
I've also tested this fix with x64 bit version, and some how it was working. I guess this is something related to GoLang. Seems like they try to align memory blocks based on arch. So if it is x32 they will align based on x32 arch (to 4 bytes) and if this is on x64 arch (to 8 bytes). So fix is basically, adding alignment to x32 version, and overwriting alignment GoLang on x64 version. But guess this should be tested. In both cases additional alignment by GoLang won't happen as 88 bytes have no needed to be aligned on x32 or x64 arch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants