Skip to content

[R][C++] Homebrew nightly test failing with illegal opcode #36685

Closed

Description

@paleolimbot

Describe the bug, including details regarding any error messages, version, and platform.

The homebrew-r-brew job is failing with address 0x1060b0219, cause 'illegal opcode'. This seems to be a recurring problem with using Homebrew and has come up a number of times (#33807, #28343, #14826 ). I suspect - but don't know - that this could be related to an M1 Mac running an x86 binary.

I don't believe this is an R-specific problem; rather, I think that the homebrew-r-brew nightly is one of the more comprehensive tests of that particular C++ package. For example, this was also exposed by GDAL's tests on Homebrew. If it is an R-specific problem then I would suggest that the solution is to remove the nightly test: linking to homebrew Arrow is difficult to achieve in practice and isn't something I feel compelled to support.

Link to failure: https://github.com/ursacomputing/crossbow/actions/runs/5540897821/jobs/10113586586#step:8:20367

Output:

Start test: ParquetFileReader $ReadRowGroup(s) methods
  'test-parquet.R:327:3' [success]
  'test-parquet.R:328:3' [success]
  'test-parquet.R:329:3' [success]
  'test-parquet.R:330:3' [success]
  'test-parquet.R:331:3' [success]
  'test-parquet.R:332:3' [success]

 *** caught illegal operation ***
address 0x1060b0219, cause 'illegal opcode'

Traceback:
 1: parquet___arrow___FileReader__ReadRowGroups1(self, row_groups)

Component(s)

C++, R

Activity

  1. westonpace commented on Jul 14, 2023

    @westonpace
    Member

    I think the ticket with the most thorough investigation of these issues is #31132 I will try and remember / summarize the discussion at the time.

    The crux of the matter is our parquet simd dispatch arguably violates the ODR. In general, we get away with this. Multiple copies of the symbol are linked in and the appropriate one is chosen via tag dispatch. In homebrew, the MinSizeRel build type is used. For whatever reason, we don't get away with our ODR violation in this case. The compiler / linker collapse all the copies with the same name into one implementation and that implementation has AVX2 instructions.

    At the time, we discussed several more thorough solutions but none of them were taken due to a fear of performance regression and, probably, a lack of energy at the time for solving this particular problem. We ended with #14342 which overrides MinSizeRel for the files that have multiple symbols. This seemed to work ok.

    Note that 474b1a5 seems to have modified the same area that #14342 did. It's possible we ended up reverting our change accidentally.

  2. kou commented on Jul 14, 2023

    @kou
    Member

    Ah, sorry. this may be related to #36583.
    I've removed ENV["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" workaround in Homebrew because we think that it's solved by #14342 and it's removed in upstream.
    But it seems that we have a regression for it. I'll take a look at this.

  3. added a commit that references this issue on Jul 16, 2023
  4. pitrou commented on Jul 19, 2023

    @pitrou
    Member

    Why not disable runtime SIMD dispatch by passing ARROW_RUNTIME_SIMD_LEVEL=NONE?

  5. added a commit that references this issue on Jul 30, 2023
  6. added this to the 14.0.0 milestone on Jul 30, 2023
  7. added a commit that references this issue on Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions