Skip to content

Race Condition in ASCOM Driver #1

@ghilios

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.

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