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

BoundsError on flush in a threaded run. #340

Open
EdsterG opened this issue Feb 27, 2025 · 5 comments
Open

BoundsError on flush in a threaded run. #340

EdsterG opened this issue Feb 27, 2025 · 5 comments

Comments

@EdsterG
Copy link

EdsterG commented Feb 27, 2025

I frequently get the following error. The progress bar is used in a threaded run, in JupyterLab, and is initialized with safe_lock=1. The error constantly happens during the flush call. Any suggestions for a quick workaround?

BoundsError: attempt to access MemoryRef{UInt8} at index [1]

Stacktrace:
  [1] memoryref
    @ ./boot.jl:523 [inlined]
  [2] take!(io::IOBuffer)
    @ Base ./iobuffer.jl:469
  [3] send_stream(name::String)
    @ IJulia ~/.julia/packages/IJulia/dR0lE/src/stdio.jl:144
  [4] flush(io::IJulia.IJuliaStdio{Base.PipeEndpoint})
    @ IJulia ~/.julia/packages/IJulia/dR0lE/src/stdio.jl:277
  [5] _updateProgress!(p::ProgressMeter.Progress; showvalues::Tuple{}, truncate_lines::Bool, valuecolor::Symbol, offset::Int64, keep::Bool, desc::Nothing, ignore_predictor::Bool, force::Bool, color::Symbol, max_steps::Int64)
    @ ProgressMeter ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:258
  [6] _updateProgress!
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:216 [inlined]
  [7] #updateProgress!#9
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:212 [inlined]
  [8] updateProgress!
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:210 [inlined]
  [9] #19
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:490 [inlined]
 [10] #13
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:454 [inlined]
 [11] lock(f::ProgressMeter.var"#13#14"{ProgressMeter.var"#19#20"{@Kwargs{}, ProgressMeter.Progress, Int64}}, l::ReentrantLock)
    @ Base ./lock.jl:232
 [12] lock_if_threading
    @ ~/.julia/packages/ProgressMeter/kVZZH/src/ProgressMeter.jl:453 [inlined]
@MarcMush
Copy link
Collaborator

does it happen only with JupyterLab? not in a local jupyter notebook or in the terminal?
do you have a MWE? even if it happens 1/100 times, it's a start for testing

@EdsterG
Copy link
Author

EdsterG commented Feb 27, 2025

Maybe JupyterLab means something different, I'm running a jupyter-lab notebook on a remote machine (pretty sure if I ran locally it would still happen, as I'm just port forwarding to the remote machine). Haven't tried in a terminal. I think a MWE might be challenging because it might require a 256 thread machine 😆.

@MarcMush
Copy link
Collaborator

I'm not sure what's the difference, i've only ever used Ijulia with (i guess) the classic jupyter notebook

In addition to the classic Jupyter Notebook, IJulia also works with JupyterLab

does it happen often enough that you can try to replicate by removing the workload and repeating until it happens?

without a MWE, it might be challenging to help you ^^

@MarcMush
Copy link
Collaborator

JuliaLang/julia#6297 might be similar but it's very old and doesn't really has a resolution

@EdsterG
Copy link
Author

EdsterG commented Feb 27, 2025

I reduced the call frequency of next! (only call it 1/6th of the time) which seems to mitigate the issue, though I'll need more time to know for sure. I'll also need some time to create a MWE, if it's even possible, since these types of bugs are highly dependent on the call pattern/workload.

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

2 participants