Skip to content

Windows-only low-level errors #38

Closed

Description

@luke-kiernan

We're using KLU.jl in PowerNetworkMatrices.jl. We've run into a few instances where code inexplicably errors on Windows only. The situations where it's cropped up have been fairly complex, though:

  1. An EXCEPTION_ACCESS_VIOLATION in the test_ac_transmission_security_constrained_models.jl test file in thesm/n-1_modf branch of PowerSimulations.jl, first test here. Even after removing all multi-threading stuff from PowerNetworkMatrices.jl, this still failed, again on windows alone. @SebastianManriqueM
  2. A BoundsError in a code snippet here. Relevant issue. This came up about a year ago--it was memorably weird, so I pushed the code to a fork to preserve it. However, to get it to run again, I'd need to go track down the compatible versions of the dependencies.

Has anyone else run into similar issues? I'll keep my eye out for a minimal reproducible example.

Activity

  1. luke-kiernan commented on Sep 11, 2026

    @luke-kiernan
    CollaboratorAuthor

    We've eliminated the issue internally, by writing our own KLU wrapper. Each ccall is enclosed in a global shared ReentrantLock: empirically, that change fixes the problem. I did not figure out the details myself--that'd be @jd-lara . The comment here describes the problem and our solution.

  2. added 4 commits that reference this issue on Oct 30, 2026
    e332fc4
    cd77553
    030a336
    d79cbd5
  3. ViralBShah commented on Oct 30, 2026

    @ViralBShah
    Member

    We haven't been able to reproduce this, so I'm closing it for now.

    Since this was reported, main has fixed several bugs that can cause failures like these:

    Concurrency stress tests now pass in CI on Windows, with both shared and separate factorizations. They don't run the applications in the report or use SuiteSparse 7.8.3, so this doesn't prove the cause was one of these bugs.

    These fixes aren't in a release yet, as the latest one is v0.6.0. Please try again on the next release, or on main until then. If it still fails, please reopen this with a repro on that version, ideally a minimal one, along with your Julia version.

    For reference, d79cbd5 has the global lock approach from your wrapper, in case a repro shows that it's needed.

  4. luke-kiernan commented on Oct 30, 2026

    @luke-kiernan
    CollaboratorAuthor

    For reference, #42 has the global lock approach from your wrapper, in case a repro shows that it's needed.

    We've made some diagnostic progress; we now only serialize the calls on windows. Details are in the _LIBKLU_LOCK docstring on the psy6 branch of PowerNetworkMatrices.jl. It might also be worth looking at the test/test_klu_threaded.jl file (link) on that branch.

  5. ViralBShah commented on Oct 31, 2026

    @ViralBShah
    Member

    @luke-kiernan Do you have commit access here? Happy to add you.

    Can you try the latest master here to see if it works fine on Windows. Lots of little things were found by the agent and fixed.

  6. luke-kiernan commented on Nov 2, 2026

    @luke-kiernan
    CollaboratorAuthor

    Do you have commit access here?

    Yes! We've switched to maintaining our own wrapper, though, so it's harder to justify fixing things over here...but I'll at least keep tabs on the status of each, so that bugfixes in one spot don't get missed in the other.

    Can you try the latest master here to see if it works fine on Windows.

    Oh sadly I don't have ready access to a windows machine. I opened this issue in response to stuff other members of the Sienna dev team were running into--I'm just the person on that team who overlaps most with the JuliaSparse org

  7. ViralBShah commented on Nov 2, 2026

    @ViralBShah
    Member

    Marking this as closed (instead of not planned), since I think one of the recent fixes should cover this. If anyone runs into issues, please file a new issue with a reproducer.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions