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

fixed bug for windows-arm64 (introduced in pull request #291) #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NicSavichev
Copy link

#291 introduced shorter INTROSPECTION_TABLE in impl_aarch64_windows.c so while public headers declare AARCH64_LAST_=78 only 54 entries were inited in kGetters kFeatureNames.
Thus iterating all features upto AARCH64_LAST_ caused crash as long as garbage pointer at kGetters[54] was called.
Current implementation seems very unsafe and in order to prevent crash we should check for kGetters array size (that corresponds to INTROSPECTION_TABLE entries). Another solution is static assert for AARCH64_LAST_ == sizeof(kGetters).

Copy link

google-cla bot commented Jun 18, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@toor1245
Copy link
Contributor

@NicSavichev, When this patch was added, there was no common INTROSPECTION_TABLE yet and table was sync with linux implementation, could you try to use src/impl_aarch64__base_implementation.inl?
For example, https://github.com/google/cpu_features/blob/main/src/impl_aarch64_macos_or_iphone.c#L20

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.

2 participants