Skip to content

[onert] Investigate why focal complains with kMaxSmallSize=6 #15157

@glistening

Description

@glistening

After #15002, build breaks on focal.

In member function 'void nnfw::cker::Einsum::contractOperands(std::vector<nnfw::cker::Tensor>&, std::vector<bool>&, nnfw::cker::Tensor*)':

cc1plus: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' forming offset [33, 36] is out of the bounds [0, 32] of object 'output_shape' with type 'nnfw::cker::Shape' [-Werror=array-bounds]

In file included from /home/jenkins/jenkins_agent/workspace/nnfw/master/push-nnpackage-test/runtime/onert/backend/cpu/ops/EinsumLayer.cc:19:

/home/jenkins/jenkins_agent/workspace/nnfw/master/push-nnpackage-test/runtime/compute/cker/include/cker/operation/Einsum.h:874:11: note: 'output_shape' declared here

Shape output_shape(old_output_shape.DimensionsCount() + inputs.size());
      |           ^~~~~~~~~~~~

Though it disappeared with #15101, I am not sure why it happens and why it disappeared.

There are several possibilities:

I don't think it is in hurry, and don't want to put much time on this case.

Note

  1. focal (Ubuntu 20.04) will reach the end of support on May 31, 2025.
  2. Our CI does not check the build on focal. (Maybe due to 1.)
  3. On the recent gcc, the error does not occurs.

However, for the little possibility of (3) and my curiosity,
it may be good to investigate on this if time permits.

  • Set up the focal build environment
  • Check einsum requires changes as kMaxSmallSize becomes 6.
  • Check 32-bit alignment in union
    union {
      int32_t _dims[kMaxSmallSize];
      int32_t *_dims_pointer{nullptr};
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions