Skip to content

Debugger does not break on @bp when using threads #273

@herzfeldd

Description

@herzfeldd

First of all, thanks for this great tool!

Unfortunately, break points don't appear to function correctly when using Threads.@threads. In particular, break points are never hit, even when explicitly placed in the code. bp on error seems to appropriately break if there is an error, but the stack trace just shows a call to ccall(:jl_threading_run, Cvoid, (Any,), threadsfor_fun), not the stack for the actual thread. I am happy to break this into two separate issues if they should be tracked separately.

Here is a MWE:

module ModuleFoo
    import Debugger
    function foo()
        println("Running with $(Threads.nthreads()) threads.")
        Threads.@threads for i = 1:Threads.nthreads()
            foo_with_bp()
        end
    end

    function foo_with_bp()
        Debugger.@bp
        error("I should never get here")
    end
end

using Debugger
@run ModuleFoo.foo()

Note: This fails to break on @bp even when you aren't explicitly using more than on thread (i.e., does not break on @bp even when JULIA_NUM_THREADS=1).

Version Info:
julia version 1.4.2
[31a5f54b] Debugger v0.6.6

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