You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[R][C++] Homebrew nightly test failing with illegal opcode #36685
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.
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.
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.
Activity
westonpace commentedon Jul 14, 2023
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.
kou commentedon Jul 14, 2023
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.
WIP: apacheGH-36685: [R][C++] Fix illegal opcode failure with Homebrew
pitrou commentedon Jul 19, 2023
Why not disable runtime SIMD dispatch by passing
ARROW_RUNTIME_SIMD_LEVEL=NONE?GH-36685: [R][C++] Fix illegal opcode failure with Homebrew (#36705)
apacheGH-36685: [R][C++] Fix illegal opcode failure with Homebrew (ap…