Skip to content

Conversation

@bmhowe23
Copy link
Collaborator

@bmhowe23 bmhowe23 commented Dec 3, 2025

This PR fixes a pre-existing issue with our extension points. Without this change, when a new decoder plugin was added and cleanup_plugins was called at the end of a program, the extension points would sometimes crash. The solution is the following:

  1. We must remove items from the registry to protect if someone were to dlclose a plugin library while keeping the parent libcudaq-qec.so library open.
  2. Similar to Fixed double free error #327, we change the static variables to pointers rather than objects. This is actually the most important change.
  3. We must use a mutex for protection against multi-threaded access to the registry. It must be a recursive_mutex to allow decoders to include other decoders (because the "get" method will try to lock multiple times in the call stack).

Also, a bit unrelated, but I also changed one of our tests to use a simulator that supports noise (stim) vs the default (which is often qpp depending on the environment). This eliminates thousands of warning messages that were introduced with NVIDIA/cuda-quantum#3113.

@bmhowe23 bmhowe23 requested a review from amccaskey December 3, 2025 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant