Skip to content

Deadlock problems still exist in version 0.17 #38

@Shuenhoy

Description

@Shuenhoy

Try this code copied from gluon-lang/gluon#842.

type Digit a =
    | One a
    | Two a a
    | Three a a a
    | Four a a a a

type Node b =
    | Node2 b b
    | Node3 b b b

type FingerTree c =
    | Empty
    | Single c
    | Deep (Digit c) (FingerTree (Node c)) (Digit c)

type View d =
    | Nil
    | View d (FingerTree d)

rec let viewl xs : FingerTree e -> View e =
    match xs with
    | Empty -> Nil
    | Single x -> View x Empty
    | Deep (One a) deeper suffix ->
        match viewl deeper with
        | View (Node2 b c) rest -> View a (Deep (Two b c) rest suffix)
        | View (Node3 b c d) rest -> View a (Deep (Three b c d) rest suffix)
        | Nil ->
            match suffix with
            | One w -> View a (Single w)
            | Two w x -> View a (Deep (One w) Empty (One x))
            | Three w x y -> View a (Deep (Two w x) Empty (One y))
            | Four w x y z -> View a (Deep (Three w x y) Empty (One z))
    | Deep (Two a b) deeper suffix -> View a (Deep (One b) deeper suffix)
    | Deep (Three a b c) deeper suffix -> View a (Deep (Two b c) deeper suffix)
    | Deep (Four a b c d) deeper suffix -> View a (Deep (Three b c d) deeper suffix)
viewl

Find this line type View d =, modify the d to a, save the file. If nothing happens, modify a back to d, save. Repeat this procedure for a few times and the LSP would lock up.

Based on the experiences of my attempts to find out the problems, this probably happens here:

thread
.get_database_mut()
.add_module(module_name.into(), &source);

But I didn't find out who is blocking it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions