# NLopt 0.3.6 segfaults Julia 0.6.2

**URL:** https://discourse.julialang.org/t/nlopt-0-3-6-segfaults-julia-0-6-2/8645
**Category:** Optimization (Mathematical)
**Created:** [January 27, 2018, 9:54pm UTC](https://discourse.julialang.org/t/nlopt-0-3-6-segfaults-julia-0-6-2/8645 "2018-01-27T21:54:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ivo\_welch](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)
#### Post date: [January 27, 2018, 9:54pm UTC](https://discourse.julialang.org/t/nlopt-0-3-6-segfaults-julia-0-6-2/8645/1 "2018-01-27T21:54:54Z")

</div>

```julia
julia> using NLopt

julia> myfun(x::Vector, unused::Vector)= (x[1]-2)^2 + (x[2]-3)^2 + (x[1]*x[2])^2
myfun (generic function with 1 method)

julia> opt= Opt(:LN_NELDERMEAD,2)
Opt(:LN_NELDERMEAD, 2)

julia> lower_bounds!(opt, [0,0])

julia> min_objective!(opt,myfun)

julia> optimize(opt, [1.0, 1.0])

signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 0
unknown function (ip: 0xffffffffffffffff)
Allocations: 1593383 (Pool: 1592149; Big: 1234); GC: 0
Segmentation fault: 11

```

(The answer is [0.2172, 2.8647].)

I am guessing that even if I give completely wrong parameters, julia should not segfault.

Advice appreciated. I encountered this while trying to learn NLopt. I am just trying to test an example of optimization without gradients. My next goal will be optimizing a stochastic equivalent, with

```julia
myfun(x::Vector, unused::Vector)= (x[1]-2)^2 + (x[2]-3)^2 + (x[1]*x[2])^2+rand()/100

```
