Skip to content

Illegal instruction on non-AVX processor #2299

@kjkjava

Description

@kjkjava

Required Info
Camera Model Any
Firmware Version Any
Operating System & Version Ubuntu 14.04
Kernel Version (Linux Only) 4.4.0
Platform Pentium
SDK Version 2.14.1
Language C++

Issue Description

As mentioned in previous issues (#1428, #1443, #1464, #1484), there have been issues executing AVX instructions on CPUs that don't support AVX (causing SIGILL, "Illegal instruction (core dumped)"). Using SDK version 2.14.1, the issue is two-fold:

  1. If I compile with -mavx, my application crashes at global initialization. I see that there is auto-selection code to bypass the AVX implementation if not supported on a CPU, but in debugging, I saw crashes in two different locations (one in librealsense and one in another library). Generally speaking, adding -mavx gives the compiler free-reign to optimize using AVX wherever it wishes, so I don't think this should always be enabled for all non-ARM builds.

  2. If I remove -mavx, the build fails due to SSSE3 guards (which my processor supports) where AVX guards should be used instead. I have a patch for this, which is ultimately the solution to my issue. I'll send a pull request with this patch shortly.

Metadata

Metadata

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