# Julia crashes without reporting anything when I optimize a vector of models in parallel

**URL:** <https://discourse.julialang.org/t/julia-crashes-without-reporting-anything-when-i-optimize-a-vector-of-models-in-parallel/131801>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, parallel\
**Created:** [August 24, 2025, 1:55am UTC](https://discourse.julialang.org/t/julia-crashes-without-reporting-anything-when-i-optimize-a-vector-of-models-in-parallel/131801 "2025-08-24T01:55:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [August 24, 2025, 4:39am UTC](https://discourse.julialang.org/t/julia-crashes-without-reporting-anything-when-i-optimize-a-vector-of-models-in-parallel/131801/5 "2025-08-24T04:39:22Z")

</div>

I revise my “crux” part code as

```julia
sub_j_vec = rand_j_vec[1+(ba-1)TH : min(J, (ba)TH)]
@info "before entering @threads" sub_j_vec
Threads.@threads for i = eachindex(sub_j_vec) # strictly This is NOT a loop
    j = sub_j_vec[i]
    @info "inside @threads" i j
end
error("#1 can you see this error??")

```

Then I observe this weird thing (why is there repetition of `j = 3` ??)

```julia-auto
julia> parallel_CG!(B, θ, β, μ, ν)
┌ Info: before entering @threads
│ sub_j_vec =
│ 4-element Vector{Int64}:
│ 1
│ 4
│ 2
└ 3
┌ Info: inside @threads
│ i = 1
└ j = 2
┌ Info: inside @threads
│ i = 2
└ j = 3
┌ Info: inside @threads
│ i = 4
└ j = 3
┌ Info: inside @threads
│ i = 3
└ j = 3
ERROR: #1 can you see this error??

```

---

_[View the full topic](https://discourse.julialang.org/t/julia-crashes-without-reporting-anything-when-i-optimize-a-vector-of-models-in-parallel/131801)._
