Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
herzfeldd opened this issue Sep 14, 2020 · 3 comments
Closed

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

herzfeldd opened this issue Sep 14, 2020 · 3 comments

Comments

@herzfeldd
Copy link

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

@KristofferC
Copy link
Member

I think this is expected for now. The threading system goes into the Julia runtime where the interpreter loses track of it.

@davidanthoff
Copy link
Contributor

See also JuliaDebug/JuliaInterpreter.jl#413.

@KristofferC
Copy link
Member

Closing in favor of the upstream issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants