# How to isolate & report non-deterministic bug

**URL:** <https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176>\
**Category:** General Usage\
**Tags:** question, bug, regression\
**Created:** [March 20, 2025, 2:42pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176 "2025-03-20T14:42:59Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 20, 2025, 2:42pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/1 "2025-03-20T14:42:59Z")

</div>

I have a large (15k LOC) calculation that works fine in 1.10.9 but gives an error in 1.11.4 (nothing else changed, not even the manifest).

I isolated the function where this happens and I can reproduce it (within my codebase). So I put some `@show` statements inside the code to figure out what is going on… and the bug disappears.

I am at loss how to debug this further. The code does not involve threading or async. The error is a counter being off by 1, as if a particular line was elided by the compiler (but how can I check this?).

But reproducing requires about 7k LOC, which I don’t want to make public at this point. Any attempts to reduce this to an MWE make the bug disapper.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 20, 2025, 3:19pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/2 "2025-03-20T15:19:26Z")

</div>

You can attempt to use creduce to (somewhat automatically) try to delete stuff that doesn’t influence the bug, but chances are that this is an issue due to either effects (which `@show` would influence negatively) or autovectorization (in which case deleting some lines may also have the same issue as `@show`). Are there any uses of `@simd` or other vectorization libraries in your code? Is `unsafe_*` used internally and some bounds check is mistakenly removed with `@inbounds`? Can you reproduce the issue with `--check-bounds=true`?

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [March 20, 2025, 3:30pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/3 "2025-03-20T15:30:29Z")

</div>

`@show` might also influence things like `similar` by changing what’s present in memory before you make the first write. If your algorithm happens to read it (which would be a coding mistake), that might result in a heisenbug.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 21, 2025, 10:03am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/4 "2025-03-21T10:03:40Z")

</div>

Thanks @Sukera and @gdalle. It is not a bounds issue, I am not using `unsafe_` or `@simd`.

The error happens in a loop not unlike

```julia
while true
    (; τ, log_mass, periods_left) = get_current_state(MLI)
    pma = period_mass_aggregates(model_approximations, group_information, P, τ, log_mass)
    mass_aggregates = add_mass_aggregates!(mass_aggregates, pma)
    if periods_left > 0
        advance_state!(MLI)
    else
        break
    end
end

```

The key parts are `get_current_state` and `advance_state!`, the latter checks internally for `periods_left >=0` and throws an error.

`@code_typed` tells me that both functions are inlined, and the function that contains the loop becomes a 800-line monster. Only one instance of `periods_left` survives (the check), so the compiler must think it can elide the others.

`@noinline` for both functions seems to fix the issue.

I think this is a compiler bug. I am still not sure if it is fixed in `master` as I have trouble loading some packages in the reproducer code, I will check that and report back.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 21, 2025, 10:17am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/5 "2025-03-21T10:17:51Z")

</div>

The fact that `@noinline` fixes the issue is indeed a good indicator of this being a compiler bug. Does running with `-O0` also fix this? Does the error reproduce on nightly?

Unfortunately, without a reproducer you can share with core devs it’s unlikely that a specific cause can be identified 😕

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 21, 2025, 10:18am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/6 "2025-03-21T10:18:58Z")

</div>

> [@Sukera](#):
>
> a reproducer you can share with core devs

I have a reproducer that I can share privately. Should I open an issue on Github?

> [@Sukera](#):
>
> Does the error reproduce on nightly?

Unfortunately I cannot tell because I cannot load JLD2, see

> <https://github.com/JuliaIO/JLD2.jl/issues/636>
>
> \`\`\`julia
> \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org
> (…\_) | (\_) (\_) |
> \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for Pkg help.
> | | | | | | |/ \_\` | |
> | | |\_| | | | (\_| | | Version 1.13.0-DEV.268 (2025-03-20)
> \_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Commit f8eaeb41309 (0 days old master)
> |\_\_/ |
> 
> (@v1.13) pkg\> activate --temp
> Activating new project at \`/tmp/jl\_y5xCZo\`
> 
> (jl\_y5xCZo) pkg\> add JLD2
> Resolving package versions...
> Updating \`/tmp/jl\_y5xCZo/Project.toml\`
> \[033835bb\] + JLD2 v0.5.11
> Updating \`/tmp/jl\_y5xCZo/Manifest.toml\`
> \[5789e2e9\] + FileIO v1.17.0
> \[033835bb\] + JLD2 v0.5.11
> \[1914dd2f\] + MacroTools v0.5.15
> \[bac558e1\] + OrderedCollections v1.8.0
> \[aea7be01\] + PrecompileTools v1.2.1
> \[21216c6a\] + Preferences v1.4.3
> \[ae029012\] + Requires v1.3.1
> \[3bb67fe8\] + TranscodingStreams v0.11.3
> \[0dad84c5\] + ArgTools v1.1.2
> \[56f22d72\] + Artifacts v1.11.0
> \[2a0f44e3\] + Base64 v1.11.0
> \[ade2ca70\] + Dates v1.11.0
> \[f43a241f\] + Downloads v1.7.0
> \[7b1f6079\] + FileWatching v1.11.0
> \[ac6e5ff7\] + JuliaSyntaxHighlighting v1.12.0
> \[b27032c2\] + LibCURL v0.6.4
> \[76f85450\] + LibGit2 v1.11.0
> \[8f399da3\] + Libdl v1.11.0
> \[56ddb016\] + Logging v1.11.0
> \[d6f4376e\] + Markdown v1.11.0
> \[a63ad114\] + Mmap v1.11.0
> \[ca575930\] + NetworkOptions v1.3.0
> \[44cfe95a\] + Pkg v1.12.0
> \[de0858da\] + Printf v1.11.0
> \[9a3f8284\] + Random v1.11.0
> \[ea8e919c\] + SHA v0.7.0
> \[f489334b\] + StyledStrings v1.11.0
> \[fa267f1f\] + TOML v1.0.3
> \[a4e569a6\] + Tar v1.10.0
> \[cf7118a7\] + UUIDs v1.11.0
> \[4ec0a83e\] + Unicode v1.11.0
> \[deac9b47\] + LibCURL\_jll v8.12.1+1
> \[e37daf67\] + LibGit2\_jll v1.9.0+0
> \[29816b5a\] + LibSSH2\_jll v1.11.3+1
> \[14a3606d\] + MozillaCACerts\_jll v2024.12.31
> \[458c3c95\] + OpenSSL\_jll v3.0.16+0
> \[83775a58\] + Zlib\_jll v1.3.1+2
> \[8e850ede\] + nghttp2\_jll v1.65.0+0
> \[3f19e933\] + p7zip\_jll v17.5.0+2
> ✗ JLD2
> Precompiling packages finished.
> 0 dependencies successfully precompiled in 18 seconds. 33 already precompiled.
> 1 dependency errored.
> For a report of the errors see \`julia\> err\`. To retry use \`pkg\> precompile\`
> 
> julia\> err                                                                                                                     
> PkgPrecompileError: The following 1 direct dependency failed to precompile:
>                                                                
> JLD2                                                
>                                                                
> Failed to precompile JLD2 \[033835bb-8acc-5ee8-8aae-3f567f8a3819\] to "/home/tamas/.julia/compiled/v1.13/JLD2/jl\_0IsKm9" (ProcessExited(1)).
> Error encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("/tmp/jl\_Etrv5F").
>                                                                
> Fatal error:                                                                                                                   
> ERROR: LoadError: ConcurrencyViolationError("deadlock detected in loading JLD2 using JLD2")
> Stacktrace:                                                                                                                    
> \[1\] canstart\_loading(modkey::Base.PkgId, build\_id::UInt128, stalecheck::Bool)
> @ Base ./loading.jl:2223                                                                                                   
> \[2\] start\_loading(modkey::Base.PkgId, build\_id::UInt128, stalecheck::Bool)
> @ Base ./loading.jl:2231                                                                                                   
> \[3\] \_require\_prelocked(uuidkey::Base.PkgId, env::Nothing)
> @ Base ./loading.jl:2501                            
> \[4\] \_require\_prelocked                                    
> @ ./loading.jl:2500 \[inlined\]
> \[5\] macro expansion
> @ ./lock.jl:376 \[inlined\]
> \[6\] \_\_require(uuidkey::Base.PkgId)
> @ Base ./loading.jl:2498                      
> \[7\] require                            
> @ ./loading.jl:2496 \[inlined\]
> \[8\] #37                                                                                                                                                                                                                                                      
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:203 \[inlined\]
> \[9\] lock(f::FileIO.var"#37#38"{Base.PkgId}, l::ReentrantLock)
> @ Base ./lock.jl:335
> \[10\] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::@Kwargs{})
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:203
> \[11\] action                                                                                                                   
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:196 \[inlined\]
> \[12\] action        
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:185 \[inlined\]
> \[13\] load(::String; options::@Kwargs{})
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:113
> \[14\] load    
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:109 \[inlined\]
> \[15\] (::JLD2.var"#123#124")(path::String, ::IOStream)                                                                         
> @ JLD2 ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:26                                                                   
> \[16\] mktemp(fn::JLD2.var"#123#124", parent::String)
> @ Base.Filesystem ./file.jl:870
> \[17\] mktemp(fn::Function)
> @ Base.Filesystem ./file.jl:868
> \[18\] macro expansion
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:15 \[inlined\]
> \[19\] macro expansion
> @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 \[inlined\]
> \[20\] macro expansion
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:14 \[inlined\]
> \[21\] macro expansion
> @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 \[inlined\]
> \[22\] top-level scope
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:139
> Stacktrace:
> \[1\] handle\_error(e::ConcurrencyViolationError, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/error\_handling.jl:71
> \[2\] handle\_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/error\_handling.jl:66
> \[3\] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::@Kwargs{})
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:228
> \[4\] action
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:196 \[inlined\]
> \[5\] action
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:185 \[inlined\]
> \[6\] load(::String; options::@Kwargs{})
> @ FileIO ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:113
> \[7\] load
> @ ~/.julia/packages/FileIO/ePyCW/src/loadsave.jl:109 \[inlined\]
> \[8\] (::JLD2.var"#123#124")(path::String, ::IOStream)
> @ JLD2 ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:26
> \[9\] mktemp(fn::JLD2.var"#123#124", parent::String)
> @ Base.Filesystem ./file.jl:870
> \[10\] mktemp(fn::Function)
> @ Base.Filesystem ./file.jl:868
> \[11\] macro expansion
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:15 \[inlined\]
> \[12\] macro expansion
> @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 \[inlined\]
> \[13\] macro expansion
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:14 \[inlined\]
> \[14\] macro expansion
> @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 \[inlined\]
> \[15\] top-level scope
> @ ~/.julia/packages/JLD2/nPYlZ/src/precompile.jl:139
> \[16\] include(mapexpr::Function, mod::Module, \_path::String)
> @ Base ./Base.jl:304
> \[17\] IncludeInto
> @ ./Base.jl:305 \[inlined\]
> \[18\] top-level scope
> @ ~/.julia/packages/JLD2/nPYlZ/src/JLD2.jl:502
> \[19\] include(mod::Module, \_path::String)
> @ Base ./Base.jl:303
> \[20\] include\_package\_for\_output(pkg::Base.PkgId, input::String, depot\_path::Vector{String}, dl\_load\_path::Vector{String}, load\_path::Vector{String}, concrete\_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
> @ Base ./loading.jl:3019
> \[21\] top-level scope
> @ stdin:5
> \[22\] eval(m::Module, e::Any)
> @ Core ./boot.jl:489
> \[23\] include\_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
> @ Base ./loading.jl:2865
> \[24\] include\_string
> @ ./loading.jl:2875 \[inlined\]
> \[25\] exec\_options(opts::Base.JLOptions)
> @ Base ./client.jl:326
> \[26\] \_start()
> @ Base ./client.jl:560
> in expression starting at /home/tamas/.julia/packages/JLD2/nPYlZ/src/precompile.jl:3
> in expression starting at /home/tamas/.julia/packages/JLD2/nPYlZ/src/JLD2.jl:1
> in expression starting at stdin:
> \`\`\`

when that is fixed I will check.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 21, 2025, 12:03pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/7 "2025-03-21T12:03:14Z")

</div>

> [@Tamas\_Papp](#):
>
> Unfortunately I cannot tell because I cannot load JLD2

Is JLD2 core to your code, or can you replace the data loading with some hardcoded/generated data?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 21, 2025, 12:09pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/8 "2025-03-21T12:09:07Z")

</div>

Yes, but it will take about half day; I will look into it.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2025, 10:24am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/9 "2025-03-24T10:24:58Z")

</div>

I managed to make a LWE (large working example 😉) without JLD2, and the bug is not present on nightly.

I am planning to bisect Julia from 1.11.4 to nightly to see what it was, is `make cleanall; make` sufficient between steps?

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [March 24, 2025, 10:31am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/10 "2025-03-24T10:31:44Z")

</div>

> [@Tamas\_Papp](#):
>
> is `make cleanall; make` sufficient between steps?

Yes, I think so (I use that because I’ve seen it recommended somewhere).

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2025, 11:37am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/11 "2025-03-24T11:37:09Z")

</div>

**EDIT** no, it was a path issue, my problem is fixed on `master`. Stay tuned for the bisection…

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 26, 2025, 5:09pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/12 "2025-03-26T17:09:44Z")

</div>

I tried bisecting and narrowed it down to a handful (~15) of commits, of which

> <https://github.com/JuliaLang/julia/pull/57201>
>
> Fixes https://github.com/JuliaLang/julia/issues/57141.
> 
> Given the function
> 
> …\`\`\`julia
> julia\> function \_f()
> ref = Ref{Any}()
> ref\[\] = 3
> @assert isdefined(ref, :x)
> inner = Returns(ref)
> x = inner()
> (x, ref\[\])
> end
> \_f (generic function with 1 method)
> 
> julia\> f() = first(\_f())
> f (generic function with 1 method)
> \`\`\`
> 
> Here is before:
> \`\`\`julia
> julia\> @code\_typed f()
> CodeInfo(
> 1 ─ %1 = %new(Base.RefValue{Any})::Base.RefValue{Any}
> └── goto #3
> 2 ─ unreachable
> 3 ─ return %1
> ) =\> Base.RefValue{Any}
> \`\`\`
> 
> Here is after this PR:
> \`\`\`julia
> julia\> @code\_typed f()
> CodeInfo(
> 1 ─ %1 = %new(Base.RefValue{Any})::Base.RefValue{Any}
> │ builtin Base.setfield!(%1, :x, 3)::Int64
> │ %3 = builtin Main.isdefined(%1, :x)::Bool
> └── goto #3 if not %3
> 2 ─ goto #4
> 3 ─ %6 = invoke Base.AssertionError("isdefined(ref, :x)"::String)::AssertionError
> │ builtin Base.throw(%6)::Union{}
> └── unreachable
> 4 ─ return %1
> ) =\> Base.RefValue{Any}
> \`\`\`
> 
> The elimination of \`setfield!\` was due to a use still being recorded for \`ref\[\]\` in the def-use data while DCE eliminated this \`getindex\` call (by virtue of not using the second tuple element in the result).

is the most likely suspect (for fixing it). Evidence for this is circumstantial (see below), but I think it is pretty likely: it was OK in 1.10, broken in 1.11, fixed in master, and indeed a `setfield!` form is missing from the lowered expression.

On a related note, I found bisecting a Julia with a nontrivial reproducer (that uses a lot of packages) quite challenging. I am running into issues with resolving packages (in theory, one can always go up and keep the `Manifest.toml`, but if some packages lower bound then this breaks), and I am running into issues like

> [@ERROR: LoadError: could not load symbol "jl\_tag\_newly\_inferred\_enable"](https://discourse.julialang.org/t/error-loaderror-could-not-load-symbol-jl-tag-newly-inferred-enable/127356/2):
>
> How to reproduce: check out the Julia repository at eg fea26ddecb8a6c404f0c501228bf17c9b384d686 and compile, start julia, thenpkg\> activate --temp pkg\> add StaticArrays@1.9.13 gives the above error message.

which eventually prevented me from pinning this down.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 27, 2025, 10:51am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/13 "2025-03-27T10:51:29Z")

</div>

Follow-up: with the help I got in the above topic I was able to bisect, which confirmed the guess above: it was [#57141](https://github.com/JuliaLang/julia/issues/57141), fixed by [#57201](https://github.com/JuliaLang/julia/pull/57201).

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [March 27, 2025, 11:27pm UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/14 "2025-03-27T23:27:25Z")

</div>

> [@Tamas\_Papp](#):
>
> The error is a counter being off by 1, as if a particular line was elided by the compiler

A subtle and hard-to-debug correctness error like this seems quite serious. The fix in [#57201](https://github.com/JuliaLang/julia/pull/57201) doesn’t seem marked to be backported to 1.11, and it seems worth asking for that so we get this fix in the next minor version of 1.11 instead of only with (potentially far in the future) 1.12 release.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [March 28, 2025, 12:02am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/15 "2025-03-28T00:02:49Z")

</div>

The two MWEs in #57141 also appear to work in v1.11.4 (not sure because an expected result wasn’t provided), so maybe #57201 fixed two things and we’re good?

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [March 28, 2025, 12:39am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/16 "2025-03-28T00:39:52Z")

</div>

[This comment](https://github.com/JuliaLang/julia/issues/57141#issuecomment-2617024969) does say that “things work as intended” in Julia 1.11.3. (And the MWEs run without error on my 1.11.4 too.)

But that issue thread points to [this commit](https://github.com/JuliaLang/julia/commit/9650510b5fa64571178cb9fe8b6799060ae0a3ac) as the bisect result for the origin of the problem, which got [merged](https://github.com/JuliaLang/julia/pull/55297) in Aug 2024 before 1.11’s release.

And the problem in the original post here occurred under 1.11.4.

At this point, I don’t know what to think anymore 😄 @Tamas_Papp I know you’ve already put in a lot of work into this, but are you confident that that is the issue that caused your problem too, and the PR that fixes it? The MWEs there don’t cause errors in 1.11.4 where your issue occurred.

It seems plausible that the same underlying bug was expressed differently in 1.11 (in your code) and 1.12 (in the MWEs), and so was fixed by the same PR, but that seems worth verifying before any backport attempts. Would it be possible for you to merge just the changes in [#57201](https://github.com/JuliaLang/julia/pull/57201) into the v1.11.4 tag of the julia repo and see if your code returns the right result in that build?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 28, 2025, 8:12am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176/17 "2025-03-28T08:12:20Z")

</div>

> [@digital\_carver](#):
>
> Would it be possible for you to merge just the changes in [#57201](https://github.com/JuliaLang/julia/pull/57201) into the v1.11.4 tag of the julia repo and see if your code returns the right result in that build?

Certainly! At

```julia
commit 8561cc3d68d3551a5728b40f782c244834fd3348 (HEAD -> release-1.11, tag:
v1.11.4, origin/release-1.11)
Author: Kristoffer Carlsson <kristoffer.carlsson@chalmers.se>
Date: Mon Mar 10 12:36:14 2025 +0100

    set VERSION to 1.11.4 (#57694)

```

the error is reproduced. Then I

```sh
git cherry-pick fea26dd

```

(the merge commit of the PR above) and the error is gone.

Again, I have reproducer code that I cannot share publicly, but I would be happy to send to a Julia dev who wants to dig into it, if necessary.

I just added a comment to the PR about backporting.

**EDIT** Is there a recommended way to request a backport other than commenting on a PR? I don’t want to have it lost.
