Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when solving without setup! #76

Closed
migarstka opened this issue Apr 26, 2020 · 1 comment · Fixed by #79
Closed

Segfault when solving without setup! #76

migarstka opened this issue Apr 26, 2020 · 1 comment · Fixed by #79
Assignees
Labels

Comments

@migarstka
Copy link
Collaborator

migarstka commented Apr 26, 2020

The following code produces a segfault in Julia:

using OSQP
model = OSQP.Model()
result = OSQP.solve!(model)

results in:

ERROR in osqp_solve: Solver workspace not initialized.

signal (11): Segmentation fault: 11
in expression starting at REPL[3]:1
getproperty at ./Base.jl:20 [inlined]
solve! at /Users/Micha/.julia/packages/OSQP/BU4WO/src/interface.jl:173
solve! at /Users/Micha/.julia/packages/OSQP/BU4WO/src/interface.jl:171
jl_apply at /Users/sabae/buildbot/worker/package_macos64/build/src/./julia.h:1631 [inlined]
do_call at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:328
eval_body at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:0
jl_interpret_toplevel_thunk_callback at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:888
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x131322a0f)
unknown function (ip: 0x0)
jl_interpret_toplevel_thunk at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:897
jl_toplevel_eval_flex at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:814
jl_toplevel_eval_flex at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:764
jl_toplevel_eval at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:823 [inlined]
jl_toplevel_eval_in at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:843
eval at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
eval_user_input at /Applications/Julia-1.3.app/Contents/Resources/julia/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
run_backend at /Users/Micha/.julia/packages/Revise/SefCg/src/Revise.jl:1042
#85 at ./task.jl:333
jl_apply at /Users/sabae/buildbot/worker/package_macos64/build/src/./julia.h:1631 [inlined]
start_task at /Users/sabae/buildbot/worker/package_macos64/build/src/task.c:659
Allocations: 33366879 (Pool: 33359381; Big: 7498); GC: 32
Segmentation fault: 11

This should be easy to fix.
I will make a PR to fix this (hopefully) sometime this week.

@migarstka migarstka added the bug label Apr 26, 2020
@migarstka migarstka self-assigned this Apr 26, 2020
@bstellato
Copy link
Collaborator

Thanks a lot Michael! It would be very helpful to have a PR. It is an error correctly reported from C but not handled properly from Julia. I think Julia is trying to access memory that was not allocated.

migarstka added a commit that referenced this issue May 18, 2020
- Check that model is not empty before `solve!()`.
- Add appropriate unit test
migarstka added a commit that referenced this issue May 19, 2020
- Check that model is not empty before `solve!()`.
- Add appropriate unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants