Skip to content

sortperm segfaults with lt=(>=) #48172

@stevengj

Description

@stevengj

Reported on discourse:

sortperm(rand(1:10,10^3), lt=(>=))

crashes with a segmentation fault. (I can reproduce on every version of Julia from 1.8 back to 0.4. In 0.3 it throws a BoundsError.)

A similar but deterministic case that reliably causes a segfault is:

a = [10, 9, 8, 9, 7, 1, 3, 10, 4, 5, 5, 4, 6, 10, 10, 2, 2, 2, 8, 9, 1, 2, 8, 6, 7, 10, 1, 3, 5, 10];
sortperm(a, lt=(>=))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorduplicateIndicates similar issues or pull requestssortingPut things in order

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions