# Fail Testing Mosek 8 -\> ERROR: LoadError: ReadOnlyMemoryError()

**URL:** <https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891>\
**Category:** Optimization (Mathematical)\
**Tags:** mosek\
**Created:** [February 7, 2018, 11:55am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891 "2018-02-07T11:55:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikfilias](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erikfilias/32/3357_2.png) [@erikfilias](https://discourse.julialang.org/u/erikfilias)\
**Post date:** [February 7, 2018, 11:55am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/1 "2018-02-07T11:55:48Z")

</div>

**Testing Mosek on Windows with Julia v0.6.2 - 32 bits.**

**I am trying to run this code:**

```julia
using JuMP
using Mosek
#using SCS

model = Model(solver=MosekSolver())
#model = Model(solver=SCSSolver())

@variable(model, Q[1:2, 1:2], SDP)
@constraint(model, Q[1,1] - 1 == Q[2,2])
@variable(model, objective)
T = [1 Q[1,1]; Q[1,1] objective]
@SDconstraint(model, T >= 0)
@objective(model, :Min, objective)
solve(model)

#println("Objective value: ", getobjectivevalue(model))
#println("Q: ", getvalue(Q))

@show getvalue(Q)
@show getobjectivevalue(model)
@show getvalue(objective)
@assert getobjectivevalue(model) == getvalue(objective)

```

**However, I could get that:**

```julia
> ERROR: LoadError: ReadOnlyMemoryError()
> Stacktrace:
> [1] (::Mosek.##375#376{Mosek.Task,Int32,Int32,Array{Int64,1},Array{Float64,1},Int32})() at C:\Users\Erik.julia\v0.6\Mosek\src\msk_functions.jl:5623
> [2] disable_sigint at .\c.jl:340 [inlined]
> [3] putbaraij(::Mosek.Task, ::Int32, ::Int32, ::Array{Int64,1}, ::Array{Float64,1}) at C:\Users\Erik.julia\v0.6\Mosek\src\msk_functions.jl:5622
> [4] loadproblem!(::Mosek.MosekMathProgSolverInterface.MosekMathProgConicModel, ::Array{Float64,1}, ::SparseMatrixCSC{Float64,Int32}, ::Array{Float64,1}, ::Array{Tuple{Symbol,Any},1}, ::Array{Tuple{Symbol,Any},1}, ::Symbol) at C:\Users\Erik.julia\v0.6\Mosek\src\MosekConicInterface.jl:278
> [5] loadproblem!(::Mosek.MosekMathProgSolverInterface.MosekMathProgConicModel, ::Array{Float64,1}, ::SparseMatrixCSC{Float64,Int32}, ::Array{Float64,1}, ::Array{Any,1}, ::Array{Any,1}, ::Symbol) at C:\Users\Erik.julia\v0.6\Mosek\src\MosekConicInterface.jl:99
> [6] loadproblem!(::Mosek.MosekMathProgSolverInterface.MosekMathProgConicModel, ::Array{Float64,1}, ::SparseMatrixCSC{Float64,Int32}, ::Array{Float64,1}, ::Array{Any,1}, ::Array{Any,1}) at C:\Users\Erik.julia\v0.6\Mosek\src\MosekConicInterface.jl:88
> [7] #build#119(::Bool, ::Bool, ::JuMP.ProblemTraits, ::Function, ::JuMP.Model) at C:\Users\Erik.julia\v0.6\JuMP\src\solvers.jl:324
> [8] (::JuMP.#kw##build)(::Array{Any,1}, ::JuMP.#build, ::JuMP.Model) at .<missing>:0
> [9] #solve#116(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at C:\Users\Erik.julia\v0.6\JuMP\src\solvers.jl:168
> [10] solve(::JuMP.Model) at C:\Users\Erik.julia\v0.6\JuMP\src\solvers.jl:150
> [11] include_from_node1 at .\loading.jl:576
> [12] include at .\sysimg.jl:14
> [13] process_options at .\client.jl:305
> [14] _start at .\client.jl:371

```

**I ran my code with SCS solver and I could get the solution but the Mosek does not working.**  
**Please, I need some help.**

---

<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:** [February 7, 2018, 11:58am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/2 "2018-02-07T11:58:58Z")

</div>

Please

1. [format your code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530),
2. provide a self-contained minimal working example.

---

<div class="post-metadata">

**Author:** ![erikfilias](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erikfilias/32/3357_2.png) [@erikfilias](https://discourse.julialang.org/u/erikfilias)\
**Post date:** [February 7, 2018, 12:43pm UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/3 "2018-02-07T12:43:25Z")

</div>

Thank you!  
I am giving more information.

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [February 8, 2018, 7:33am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/4 "2018-02-08T07:33:24Z")

</div>

Just to let people know. This question is crossposted at the repo, where the MOSEK guys are trying to sort it out: [https://github.com/JuliaOpt/Mosek.jl/issues/144](https://github.com/JuliaOpt/Mosek.jl/issues/144)

---

<div class="post-metadata">

**Author:** ![Stephen\_Vavasis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephen_vavasis/32/3389_2.png) [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Post date:** [February 9, 2018, 2:47am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/5 "2018-02-09T02:47:25Z")

</div>

I too encountered a mysterious ReadOnlyMemoryError() in 0.6.2 under linux. Here is the discourse link:

> [@ReadOnlyMemoryError](https://discourse.julialang.org/t/readonlymemoryerror/8548):
>
> I have a lengthy code that recently has stopped working on my Linux machine (Julia 0.6.2) although it’s still fine on Windows. I don’t have a MWE; the site of the error moves with small changes to the code. Anyone have experience with this? Any idea how to chase it down? ERROR: LoadError: ReadOnlyMemoryError() Stacktrace: [1] handle\_eval!(::conic\_solve\_cohesive.B\_Handle, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64) at /u4/vavasis/cohesive/conic\_…

The issue is not yet resolved.

---

<div class="post-metadata">

**Author:** ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)\
**Post date:** [February 9, 2018, 5:03am UTC](https://discourse.julialang.org/t/fail-testing-mosek-8-error-loaderror-readonlymemoryerror/8891/6 "2018-02-09T05:03:31Z")

</div>

I’ve had that error once or twice when using readcsv / readdlm on kaggle’s kernels platform, passing though an IOBuffer with default settings (readable=true / writeable = true / etc) seemed to help. [/readonly? fix for readdlm](https://discourse.julialang.org/t/csv-jls-csv-write-seems-slow/7643/12)  
Reading a file probably shouldn’t need write access though.

-Added: had a little dig and there’s a `fill( **readonly?** stringbuff, 1,0 ) ` hiding in DLMStore() -base/dataFmt.jl line 211 that might err if it passes a reference?
