# Segmentation Fault Error using Julia LibCurl Wrapper

**URL:** <https://discourse.julialang.org/t/segmentation-fault-error-using-julia-libcurl-wrapper/31201>\
**Category:** General Usage\
**Created:** [November 18, 2019, 1:31am UTC](https://discourse.julialang.org/t/segmentation-fault-error-using-julia-libcurl-wrapper/31201 "2019-11-18T01:31:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkapurbh](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rkapurbh](https://discourse.julialang.org/u/rkapurbh)\
**Post date:** [November 18, 2019, 1:31am UTC](https://discourse.julialang.org/t/segmentation-fault-error-using-julia-libcurl-wrapper/31201/1 "2019-11-18T01:31:45Z")

</div>

Running the Following Code with Julia `LibCurl.jl`

```julia
curl_header_list = Cstring[]

    for header in keys(headers)
        value = headers[header]
        item =Cstring(pointer("$header: $value"))
        push!(curl_header_list, item)
    end

    curl_easy_setopt(curl, CURLOPT_URL, "$burl/api/v1/order/bulk")
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_header_list)

    res = curl_easy_perform(curl);

```

We are receiving the following segmentation fault error message:

```julia
signal (11): Segmentation fault
in expression starting at /home/ubuntu/speed_test.jl:208
Curl_safe_strcasecompare at /home/ubuntu/.julia/packages/LibCURL/lWJxD/deps/usr/lib/libcurl.so (unknown line)
Allocations: 3088296 (Pool: 3087464; Big: 832); GC: 6
Segmentation fault (core dumped)

```

---

<div class="post-metadata">

**Author:** ![bluesmoon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bluesmoon/32/327_2.png) [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Post date:** [October 22, 2021, 3:41pm UTC](https://discourse.julialang.org/t/segmentation-fault-error-using-julia-libcurl-wrapper/31201/2 "2021-10-22T15:41:07Z")

</div>

Try this code:

```julia
    slist = Ptr{Cvoid}(0)
    for header in keys(headers)
        slist = curl_slist_append(slist, "$header: $(headers[header])")
    end

    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist)

```
