Skip to content

Segmentation fault (random) when using xf::iselect or xf::ilocate #230

Description

@jfnavarro

I have a piece of code where I try to slice a xframe object by rows and columns indexes. using 3 dynamic integer thresholds. When I try to slice with either xf::iselect or xf::ilocate I get random segmentation faults at

xt::xkeep_slice<long>::operator()(long) const

This is the code where I perform the slicing:

    const auto data_value = m_data.data().value();
    const auto row_sums = xt::sum(xt::greater(data_value, threshold1), 1);
    const auto row_indexes = xt::ravel_indices<xt::ravel_vector_tag>(
                xt::argwhere(xt::equal(row_sums > threshold_2, 1)), row_sums.shape());
    const auto col_sums = xt::sum(xt::greater(data_value, threshold_1), 0);
    const auto col_indexes = xt::ravel_indices<xt::ravel_vector_tag>(
                xt::argwhere(xt::equal(col_sums > threshold_3, 1)), col_sums.shape());
    variable_type data = xf::ilocate(m_data, xf::ikeep(row_indexes), xf::ikeep(col_indexes));

I am using the latest version of xframe (0.2.0) and xtensor (0.20.7)

Sometimes I get the segmentation fault the first time sometimes it happens the 4th or 5th time I apply the slicing.

I can provide the data frame if requested.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions