Skip to content

task_done_hook has no InterruptException handler #19467

Closed

Description

Case 1:

function try_no_segfault()
    while true
        try
            sleep(1)
            println("trying...")
            # @async 1+1
        catch e
            if typeof(e) <: InterruptException
                println("caught Interrupt")
                return
            end
        end
    end
    return
end

Case 2:

function try_segfault()
    while true
        try
            sleep(1)
            println("trying...")
            @async 1+1
        catch e
            if typeof(e) <: InterruptException
                println("caught Interrupt")
                return
            end
        end
    end
    return
end

In the successful case, run try_no_segfault(), then CTRL+c to see a successful interrupt and return to the julia prompt.

To reproduce the segfault, run try_segfault(), then CTRL+c to see a segfault and end of the julia session.

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

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorerror handlingHandling of exceptions by Julia or the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions