# Memory corruption error in Julia: "Incorrect checksum for freed object" when running a JuMP/Gurobi model

**URL:** <https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, gurobi\
**Created:** [July 6, 2025, 12:16pm UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522 "2025-07-06T12:16:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonie25](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@leonie25](https://discourse.julialang.org/u/leonie25)\
**Post date:** [July 6, 2025, 12:16pm UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/1 "2025-07-06T12:16:00Z")

</div>

I am encountering a memory corruption error when running my optimization model using JuMP with the Gurobi solver in Julia. The error message is as follows:

```julia
julia(30498,0x2012a5f00) malloc: Incorrect checksum for freed object 0x143255e00: probably modified after being freed.
Corrupt value: 0xc13da6be19f5e728
julia(30498,0x2012a5f00) malloc: *** set a breakpoint in malloc_error_break to debug

```

---

<div class="post-metadata">

**Author:** ![leonie25](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@leonie25](https://discourse.julialang.org/u/leonie25)\
**Post date:** [July 6, 2025, 2:38pm UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/2 "2025-07-06T14:38:03Z")

</div>

There is a lazy constraint callbacks.

I have upgraded Julia, JuMP, and Gurobi.jl to the latest versions, yet the error persists intermittently—even when I set the `"Threads"` attribute to 1.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 6, 2025, 9:22pm UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/3 "2025-07-06T21:22:19Z")

</div>

Hi @leonie25, can you provide a reproducible example of your code?

I have two questions:

- Are you using the solver-specific callback?
- Are you using multithreading in Julia?

---

<div class="post-metadata">

**Author:** ![leonie25](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@leonie25](https://discourse.julialang.org/u/leonie25)\
**Post date:** [July 7, 2025, 4:29am UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/4 "2025-07-07T04:29:21Z")

</div>

- I’m using the solver-indepedent callbacks [Solver-independent Callbacks · JuMP](https://jump.dev/JuMP.jl/stable/manual/callbacks/#Lazy-constraints)
- not using multithread in Julia.

I replied your email with a reproducible example of the code.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 7, 2025, 4:59am UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/6 "2025-07-07T04:59:26Z")

</div>

I have identified a bug in Gurobi.jl related to callbacks with the new MINLP support in Gurobi 12. I’ll make a patch and a new release ASAP.

PR: [Fix callback with MINLP and hidden variables by odow · Pull Request #640 · jump-dev/Gurobi.jl · GitHub](https://github.com/jump-dev/Gurobi.jl/pull/640)

---

<div class="post-metadata">

**Author:** ![leonie25](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@leonie25](https://discourse.julialang.org/u/leonie25)\
**Post date:** [July 7, 2025, 5:15am UTC](https://discourse.julialang.org/t/memory-corruption-error-in-julia-incorrect-checksum-for-freed-object-when-running-a-jump-gurobi-model/130522/7 "2025-07-07T05:15:04Z")

</div>

Thanks!
