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

Devices with LinearCmd features before ScalarCmd will trigger index out of bounds errors #668

Closed
blackspherefollower opened this issue Nov 8, 2024 · 3 comments
Assignees
Labels

Comments

@blackspherefollower
Copy link
Collaborator

If a device is defined to have a LinearCmd feature followed by a ScalarCmd features, sending a ScalarCmd will trigger an index out of bounds error at src\server\device\protocol\actuator_command_manager.rs:231

This was captured in https://nonpolynomial.sentry.io/issues/4643392620/events/fb027d99efc041d9bb8c33b30cca4c19/?project=4505694319476736

It appears the v4 global feature indexing was not accounted for in the actuator_command_manager.rs state manager logic: if a non-ScalarCmd feature precedes a ScalarCmd (or a RotateCmd), the feature index will not match the ScalarCmd states index.

E.g.
feature 0, LinearCmd (not stateful)
feature 1, ScalarCmd -> state array has a size of 1, but the feature index is used to store it's state: state[1] results in the out of bounds error.

@qdot
Copy link
Member

qdot commented Nov 16, 2024

Do you think this is also #656 ? I'll dupe that against this if so, since this has more detail

@blackspherefollower
Copy link
Collaborator Author

Yes, I suspect it is. Sorry, I should really have searched the issues for the error.

@qdot
Copy link
Member

qdot commented Nov 16, 2024

Nah you're fine, I didn't really know what the error was so it was kinda hard to discern. Since this one has details and a fix I'll just dupe the other.

blackspherefollower added a commit to blackspherefollower/buttplug-rs that referenced this issue Nov 17, 2024
blackspherefollower added a commit to blackspherefollower/buttplug-rs that referenced this issue Nov 17, 2024
This does not apply to RotateCmd because there isn't a v3->v4 feature index converter yet.

Fixes buttplugio#668
blackspherefollower added a commit to blackspherefollower/buttplug-rs that referenced this issue Nov 17, 2024
This does not apply to RotateCmd because there isn't a v3->v4 feature index converter yet.

Fixes buttplugio#668
blackspherefollower added a commit to blackspherefollower/buttplug-rs that referenced this issue Nov 17, 2024
This does not apply to RotateCmd because there isn't a v3->v4 feature index converter yet.

Fixes buttplugio#668
qdot pushed a commit that referenced this issue Nov 20, 2024
This does not apply to RotateCmd because there isn't a v3->v4 feature index converter yet.

Fixes #668
@qdot qdot closed this as completed in add4f35 Dec 21, 2024
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