Skip to content

Race Condition in ASCOM Driver #1

Description

@ghilios

Hi, I'm a NINA contributor. I was investigating a user's issue with the AF3 device and I root caused it to a race condition in your code.

Please look at https://github.com/DeepSkyDad/AF3/blob/master/DeepSkyDad.AF3.ASCOM/DriverExtension.cs. "hasHandle" is a class-scope variable. If the device is in the middle of responding to one command and takes more than 2 seconds when another call comes in, the 2nd one will fail and set "hasHandle" to false. Then when the first completes it'll never release the mutex and all calls from then on will fail. I built a fix for the user by moving the variable just to the function.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions