# Memory corruption bugs in ECOS.jl and SCS.jl

**URL:** <https://discourse.julialang.org/t/memory-corruption-bugs-in-ecos-jl-and-scs-jl/7582>\
**Category:** Optimization (Mathematical)\
**Created:** [December 6, 2017, 10:26pm UTC](https://discourse.julialang.org/t/memory-corruption-bugs-in-ecos-jl-and-scs-jl/7582 "2017-12-06T22:26:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [December 6, 2017, 10:26pm UTC](https://discourse.julialang.org/t/memory-corruption-bugs-in-ecos-jl-and-scs-jl/7582/1 "2017-12-06T22:26:50Z")

</div>

We recently discovered and corrected memory corruption bugs in both ECOS.jl and SCS.jl. The wrappers did not properly keep a reference in Julia to the memory passed to the solvers, so if the GC fired at an inopportune time, it could result in the solver reading from or writing to freed memory (e.g., causing segfaults). Crashes have been observed, but rarely. The issue has been present in all releases of the packages.

ECOS v0.8.0 is tagged and contains the [fix](https://github.com/JuliaOpt/ECOS.jl/pull/63) (requires Julia 0.6+).  
SCS `master` branch contains the [fix](https://github.com/JuliaOpt/SCS.jl/pull/91). The release is held up by a concurrent transition to SCS 2.x and getting binaries available on all platforms.
