Skip to content

Opening a controller over USB occasionally crashes the entire PC (full Windows restart) #113

@hero-snow

Description

@hero-snow

Hi team,

I encountered an issue where my PC crashed while developing my custom application using the thorlabs_xa Python package.

To debug, I used an AI assistant to analyze the logs and generate a detailed report. See below for details.

Summary

When our application opens a connection to a controller over USB (the TLMC_Open
call), the whole computer occasionally crashes and restarts — not just our
program. It does not happen every time; the same connection step usually works,
but every so often opening a device takes the entire PC down.

Environment

  • thorlabs_xa Python package: 1.2.1.27471
  • Bundled native XA API DLL: ProductVersion 1.7.14.27471 (the DLL shipped
    inside the Python package)
  • OS: Windows 11 Pro (build 10.0.26200)
  • Connection: USB
  • Controller:
    • Serial numbers: 104465124 (main), 104465125 (X) and 104465126 (Y)
    • Controller model: BBD302
    • Controller FW: 1.1.12
    • Stage model: MLS203
  • Powered USB hub or direct connection: direct connection

What happens

  • During the initial open of a device (TLMC_Open), the PC sometimes freezes
    and reboots on its own.
  • Our software installs a handler that writes a log file for normal program
    crashes. For these events nothing is written — the machine goes down before
    anything can be saved. To us this looks like a low-level/driver-level fault
    rather than an error our program could catch or handle.

When it happens

  • Only during connecting (opening the device).
  • It has never happened while moving, homing, reading status, or closing a
    device — only at the open step.
  • It is intermittent: most of the time opening the two devices works fine and
    the system runs for many minutes without trouble.

A possible pattern (not confirmed)

  • It seems more likely on the first open right after the controller has been in
    an unusual state
    — for example shortly after a previous session ended badly,
    or after the controller was just powered on. In one case the API took about 23
    seconds just to start up before the crash, which may suggest the USB connection
    was already struggling at that moment.

Steps to reproduce (best effort)

  1. Connect stage controller over USB.
  2. Open both axis devices with TLMC_Open in the default operating mode.
  3. Repeat connect/disconnect cycles over a normal working session.
  4. Occasionally, an open step crashes and restarts the whole PC.

Questions

  1. Is this a known issue with TLMC_Open over USB on these controllers?
  2. Is there a recommended way to open devices more safely (for example a
    different operating mode, a settling delay, or a health check before opening)?
  3. Any logs or diagnostic info you'd like us to collect to help track this down?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions