Opened 5 years ago

Last modified 4 years ago

#58554 assigned defect

bazel @0.26.0_0 crashes on Illegal Instruction on my very old iMac (20-inch, Mid 2007)

Reported by: snowflake (Dave Evans) Owned by: jonesc@…
Priority: Normal Milestone:
Component: ports Version: 2.5.99
Keywords: Cc: missa-prime (Mohamed Issa), jonesc@…
Port: bazel

Description

Environment: macOS ElCapitan (10.11.6)

Processor:

Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz

CPU Features:

machdep.cpu.feature_bits: 250404108237823
machdep.cpu.extfeature_bits: 4832888832
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 DTES64 MON DSCPL VMX EST TM2 SSSE3 CX16 TPR PDCM
machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF

bazel has been compiled using the ROUNDSS instruction, which is only available with the SSE4_1 feature which the T7700 processor does not have.

This is according to https://www.felixcloutier.com/x86/roundss which is derived from the Intel processor manual.

I have attached the lldb log.

Attachments (3)

log (3.9 KB) - added by snowflake (Dave Evans) 5 years ago.
lldb log of bazel starting up and crashing
build-3.june.2019.log (4.8 KB) - added by snowflake (Dave Evans) 5 years ago.
bazel build failure on El Capitan and iMac 2007
build-3.june.2019-21.39.log (5.5 KB) - added by snowflake (Dave Evans) 5 years ago.
I ran a build with port -v build. It shows an illegal instruction. The Portfile was the original for the port

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by snowflake (Dave Evans)

Attachment: log added

lldb log of bazel starting up and crashing

comment:1 Changed 5 years ago by cjones051073 (Chris Jones)

Could you try forcing a 'build from source' build of bazel on the old machine, to see if that helps. i.e.

sudo port uninstall bazel
sudo port -s install bazel

if that works then it looks like bazel detects the machine capabilities, and is detecting a feature on the buildbots which you don't have. We could then look into restricting the features used by default.

Changed 5 years ago by snowflake (Dave Evans)

Attachment: build-3.june.2019.log added

bazel build failure on El Capitan and iMac 2007

comment:2 in reply to:  1 Changed 5 years ago by snowflake (Dave Evans)

Replying to cjones051073:

Could you try forcing a 'build from source' build of bazel on the old machine, to see if that helps. i.e.

sudo port uninstall bazel
sudo port -s install bazel

if that works then it looks like bazel detects the machine capabilities, and is detecting a feature on the buildbots which you don't have. We could then look into restricting the features used by default.

I tried that, but the build fails at step 921. It seems to use jdk-12.0.1 regardless of what JAVA_HOME is set to. I tried jdk1.8.0_211 and also unsetting JAVA_HOME.

The last 50 lines of the log is attached.

comment:3 Changed 5 years ago by cjones051073 (Chris Jones)

The build intentionally ignores whatever setting you might have in your local environment.

The port instead uses the java PortGroup to satisfy its java dependency.

https://github.com/macports/macports-ports/blob/master/devel/bazel/Portfile

see lines 40-43.

If you want to change the JDK version used, you have to change these lines in the portfile. Note the comments in

https://github.com/macports/macports-ports/blob/master/_resources/port1.0/group/java-1.0.tcl

regarding the syntax for the version.

comment:4 in reply to:  3 Changed 5 years ago by snowflake (Dave Evans)

Replying to cjones051073: I changed the Portfile to use JDK 1.8 (1.8.0_211-b12) and the build stopped in more or less the same place as before.

921 / 972] checking cached actions

ERROR: Could not build Bazel
Command failed: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home VERBOSE=yes BAZEL_WRKDIR=/opt/local/var/macports/build/_Users_davidevans_junk_bazel_devel_bazel/bazel/work ./compile.sh
Exit code: 1

Changed 5 years ago by snowflake (Dave Evans)

Attachment: build-3.june.2019-21.39.log added

I ran a build with port -v build. It shows an illegal instruction. The Portfile was the original for the port

comment:5 Changed 5 years ago by cjones051073 (Chris Jones)

I suspect the java version is a red herring, and not the problem. Looking again at the log I more suspect its just a failure of the bazel build system, on your old CPU. As such this is something you should take up with the bazel developers, as I don't think its a MacPorts packaging issue. The port built find on the builedbot, for 10.11, so its not a general issue with the OS.

See https://github.com/bazelbuild/bazel for details on where to submit an upstream issue with the developers.

comment:6 Changed 5 years ago by snowflake (Dave Evans)

Thanks for your work on this.

I don't think I'm going to get very far with Bazel. I tried building from src with the distribution zip, but it fails with:

tools/osx/xcode_locator.m:185:50: error: no visible @interface for 'NSDictionary' declares the selector 'initWithContentsOfURL:error:'

This selector was only introduced in macOS 10.13+

I accept that my processor is too old and so is my Xcode.

comment:7 Changed 5 years ago by cjones051073 (Chris Jones)

Yeah... The xcode locator issue is one of the tweaks the port does to get it to build at all on 10.11. See

https://github.com/macports/macports-ports/blob/master/devel/bazel/Portfile

line 101.

I agree its unlikely you will get much from upstream to help, as they have probably dropped these old systems.

comment:8 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

This ticket appears to have stalled, but it's pretty clear from the description what the problem is: the build has detected capabilities of the processor (of our build machine, which is an Xserve3,1 with Xeon processors) at build time and made use of processor-specific features in the build.

The ticket was reported against bazel 0.26.0, which we no longer have in MacPorts. We currently have 3.4.1 in the bazel port, 2.0.0 in the bazel-2.0 port, and 0.25.2 in the bazel-0.25 port. If the issue is present in any of those versions, it should be fixed by instructing the build system not to detect and use processor features that are not available in all Macs that can use these ports.

Note: See TracTickets for help on using tickets.