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

Can SIGILL if compile with cpu features and execute without it #54

Open
zzau13 opened this issue Jul 2, 2020 · 3 comments
Open

Can SIGILL if compile with cpu features and execute without it #54

zzau13 opened this issue Jul 2, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@zzau13
Copy link
Owner

zzau13 commented Jul 2, 2020

At b_escape function can produce SIGILL cpu exception.

If you compile in to target_arch x86_64 and target_feature avx2 and sse2, you will be forced to execute this function in a cpu with the previous characteristics. In any other way it will produce this exception

There is no cheap way to implement runtime detection until rust-lang/rust#57775 is resolved.

@zzau13 zzau13 added the bug Something isn't working label Jul 2, 2020
@zzau13 zzau13 changed the title Can **SIGILL** compile with cpu features and execute without it Can SIGILL if compile with cpu features and execute without it Jul 2, 2020
@Chaostheorie
Copy link

So this might be a bit late but wouldn't it be possible to add a check for the function, i.e. a check that ensures the relevant input is additionally checked at runtime even if possibly expensive, with a build-time check for the current CPU features (Rust Docs)? This will make yarte slower on CPUs not supporting the features though this solution wouldn't exclude them at least.

@zzau13
Copy link
Owner Author

zzau13 commented Nov 16, 2021

@Chaostheorie Sorry for taking time to respond. Yes. A once call function can be added for check runtime cpu flags are the same as the compile cpu flags. This function could be launched at the beginning of the application and panic in case of error.

@zzau13
Copy link
Owner Author

zzau13 commented Nov 16, 2021

This will make yarte slower on CPUs not supporting the features though this solution wouldn't exclude them at least.

The other architectures are not excluded, for architectures other than x86_64 has no effect, the fallback is launched, basically because it is not implemented with any other architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants