Skip to content

Influxdb 3 Core/Enterprise 'illegal instruction' on x86_64 CPU with CPUs older than Intel Haswell #26150

Closed
@jdstrand

Description

@jdstrand

https://github.com/influxdata/influxdb/blob/main/.cargo/config.toml#L21 lists:

[target.x86_64-unknown-linux-gnu]
rustflags = [
    ...
    # Enable all features supported by CPUs more recent than haswell (2013)
    "-C", "target-cpu=haswell",

I have an old test machine (Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz) with up to date Ubuntu 18.04 LTS, but despite having proper glibc compatibility, it fails to run:

$ ./influxdb3 -V
Illegal instruction (core dumped)

$ gdb ./influxdb3
...
Program received signal SIGILL, Illegal instruction.
(gdb) run -V

(gdb) x/i $pc
=> 0x555558233124 <_ZN12clap_builder5error14Error$LT$F$GT$5print17hcabd755f43c3aba1E+8484>:	shrx   %r12d,%eax,%r12d

Googling tells me that the shrx instruction was introduced with the Intel BMI2 (Bit Manipulation Instruction Set 2) extension, which was first supported in Intel's Haswell microarchitecture, released in 2013.

It appears that this was introduced because we wanted the avx2 instruction, first introduced in haswell: https://github.com/influxdata/influxdb_iox/pull/2119 states "I think that the current setting for ROARING_ARCH of x86-64 may not be specific enough to ensure that things are built with the avx2 instructions. Ivy Bridge Haswell has those so I think that this should work better." https://github.com/influxdata/influxdb_iox/pull/2140 has additional information.

It's apparently quite intentional that we don't support CPUs older than haswell. We probably need a documentation note for this. I expect this issue to be closed but wanted to file it for posterity since others will likely run into this.

cc @pauldix, @peterbarnett03, @alamb (since you wrote https://github.com/influxdata/influxdb_iox/pull/2140), @sanderson and @jstirnaman

References:

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