Skip to content

Error in DIANNtoMSstatsFormat on linux #214

Open

Description

@jd690764

Hi,

I am analyzing DIANN results msstats+ and got an error in DIANNtoMSstatsFormat - when I run it on a linux machine. On mac, there is no problem. I am using v4.20.0 for MSstats and v1.22.0 for MSstatsConvert on both platforms. I attached a file containing the assessment of the issue by claude.

Can you please look into this - thank you,
Janos

MSstatsConvert_isolation_forest_bug_report.md

Activity

  1. self-assigned this
    on Aug 9, 2026
  2. Rudhik1904 commented on Aug 9, 2026

    @Rudhik1904
    Contributor

    Hi,

    Thanks for the detailed report, and for the write-up that came with it — that made this much faster to track down.

    Root cause confirmed: the crash is in isolation_tree() in src/isolation_forest.cpp, the C++ code behind calculateAnomalyScores = TRUE's isolation-forest anomaly scoring. When a quality-metric value is missing (NaN) for the first row examined in a PSM group, the code fails to guard against it, which can lead to std::uniform_real_distribution being constructed with invalid (NaN) bounds — undefined behavior that's silently tolerated on macOS's C++ library but triggers a hard crash on some Linux builds, exactly matching what you saw (unserialize(node$con) is the downstream symptom of the worker process dying, not the root cause itself).

    Fix: pushed in PR #142 on the test/linux-assertion-repro branch. It:

    Fixes the underlying bug so missing values can no longer poison the split calculation.
    Adds a regression test that specifically reproduces this scenario.
    Was verified to reproduce the original crash pre-fix, and confirmed fixed, on Linux CI.
    How you can test it yourself, on the machine where you originally saw the crash:

    install the fix branch directly

    remotes::install_github("Vitek-Lab/MSstatsConvert", ref = "test/linux-assertion-repro")
    Then re-run your original DIANNtoMSstatsFormat() call with calculateAnomalyScores = TRUE as before — it should complete without the crash.

    In the meantime, if you need to unblock your analysis before this is merged, you can run with calculateAnomalyScores = FALSE to skip anomaly scoring entirely; the rest of the DIA-NN import is unaffected by this bug.

    Let us know if the fix branch resolves it on your end, or if you run into anything else — happy to keep digging if needed.

  3. tonywu1999 commented on Aug 17, 2026

    @tonywu1999
    Contributor

    @jd690764

    The fix will be pushed into the Bioconductor devel branch over the next few days and will be in the next scheduled release on November of this year. You can install from Bioconductor devel:

    if (!require("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    
    ## The following initializes the development version of Bioconductor
    BiocManager::install(version = "devel")
    
    BiocManager::install("MSstatsConvert")
    

    Let us know if you need this change on RELEASE 3.23 in Bioconductor (rather than just devel in Bioconductor).

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

Metadata

Metadata

Assignees

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