quarkus: Native application gets Killed: 9 on macOS Big Sur with binutils on the path

I have a simple project created by maven extension as described in https://quarkus.io/guides/getting-started#bootstrapping-the-project. Running mvn clean verify -Dnative ends with Failed to start native image, process has exited on macOS Big Sur. EDIT: the main problem is in binutils, see https://github.com/quarkusio/quarkus/issues/13856#issuecomment-755178876

I didn’t have this problem on the previous macOS version 10.15 Catalina. I noticed this issue only on macOS Big Sur.

Using GraalVM 20.3.0

native-image --version
GraalVM Version 20.3.0 (Java Version 11.0.9+10-jvmci-20.3-b06)

Running just the native binary gives Killed: 9

target/getting-started-1.0.0-SNAPSHOT-runner
Killed: 9

I tried to remove some metadata from the generated native binary, but that didn’t help

sudo xattr -d -r com.apple.quarantine  target/getting-started-1.0.0-SNAPSHOT-runner
target/getting-started-1.0.0-SNAPSHOT-runner
Killed: 9

Native image build went well:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 20.3.0 (Java Version 11.0.9+10-jvmci-20.3-b06)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /Users/rsvoboda/.sdkman/candidates/java/20.3.0.r11-grl/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -jar getting-started-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace getting-started-1.0.0-SNAPSHOT-runner
[getting-started-1.0.0-SNAPSHOT-runner:1817]    classlist:   2,235.29 ms,  0.96 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]        (cap):   3,473.40 ms,  1.18 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]        setup:   5,182.05 ms,  1.18 GB
22:07:27,877 INFO  [org.jbo.threads] JBoss Threads version 3.1.1.Final
[getting-started-1.0.0-SNAPSHOT-runner:1817]     (clinit):     538.76 ms,  2.30 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]   (typeflow):  11,338.02 ms,  2.30 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]    (objects):  10,285.37 ms,  2.30 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]   (features):     479.63 ms,  2.30 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]     analysis:  23,489.96 ms,  2.30 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]     universe:   1,402.86 ms,  3.25 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]      (parse):   3,104.44 ms,  3.25 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]     (inline):   6,345.91 ms,  3.86 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]    (compile):  23,821.26 ms,  5.24 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]      compile:  35,269.13 ms,  5.24 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]        image:   4,033.51 ms,  5.25 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]        write:     986.77 ms,  5.25 GB
[getting-started-1.0.0-SNAPSHOT-runner:1817]      [total]:  72,858.51 ms,  5.25 GB
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 75495ms

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29 (25 by maintainers)

Commits related to this issue

Most upvoted comments

@patped Sent a PR to fix it once and for all (see https://github.com/quarkusio/quarkus/pull/20297), but there’s a very easy workaround here: Either do brew uninstall binutils, or remove it from the default PATH and only bring it into PATH when you really need it.

@patped I’m looking into it 😃

After running objcopy --strip-debug on Hello World binary I get Killed: 9 too

rsvoboda RS $ sdk use java 20.3.0.r11-grl && export GRAALVM_HOME=$JAVA_HOME

Using java version 20.3.0.r11-grl in this shell.

rsvoboda RS $ native-image HelloWorld
[helloworld:95653]    classlist:   1,553.57 ms,  0.96 GB
[helloworld:95653]        (cap):   2,016.78 ms,  0.96 GB
[helloworld:95653]        setup:   3,333.36 ms,  0.96 GB
[helloworld:95653]     (clinit):     170.06 ms,  1.22 GB
[helloworld:95653]   (typeflow):   4,369.42 ms,  1.22 GB
[helloworld:95653]    (objects):   4,178.25 ms,  1.22 GB
[helloworld:95653]   (features):     219.73 ms,  1.22 GB
[helloworld:95653]     analysis:   9,135.71 ms,  1.22 GB
[helloworld:95653]     universe:     350.87 ms,  1.22 GB
[helloworld:95653]      (parse):   1,039.70 ms,  1.22 GB
[helloworld:95653]     (inline):   1,493.86 ms,  1.67 GB
[helloworld:95653]    (compile):   7,670.69 ms,  2.28 GB
[helloworld:95653]      compile:  10,741.89 ms,  2.28 GB
[helloworld:95653]        image:   1,529.52 ms,  2.28 GB
[helloworld:95653]        write:     593.85 ms,  2.28 GB
[helloworld:95653]      [total]:  27,419.89 ms,  2.28 GB
 
rsvoboda RS $ du -h helloworld
7.7M	helloworld

rsvoboda RS $ ./helloworld
Hello, World!

rsvoboda RS $ objcopy --strip-debug helloworld

rsvoboda RS $ du -h helloworld
7.6M	helloworld

rsvoboda RS $ ./helloworld
Killed: 9