# Segfault on DataFrames \`getindex\`

**URL:** <https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612>\
**Category:** General Usage\
**Created:** [February 9, 2019, 6:59pm UTC](https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612 "2019-02-09T18:59:46Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [February 9, 2019, 9:58pm UTC](https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612/5 "2019-02-09T21:58:29Z")

</div>

There is no `@inbounds` present in the code.  
My theory on the cause of this was that it was related to some `@inbounds` that was added to DataFrames itself during the switch to returning views.  
But I could not find them, in the DataFrames.jl source.

Nothing out of bounds **should** be being read, since it works fine _if_ `GC.gc` is called it works find and gives correct results (I think they are correct at least, could be garbage.)

The general structure of the code is

```julia
for (i, df) in enumerate(groupby(mydataframe, :n))
        for foo in (1,2)
                x = df[1, :n]
                # other operations on `x` and `foo` that do not touch any dataframes
                @show 1 # Add this to stop segufault.
         end
end

```

(Someone came to me with this segfault, and when I found that added `@show` fixed it, i was pretty WAT, and so Rory is looking at it.)

---

_[View the full topic](https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612)._
