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
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to galderz/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to galderz/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to galderz/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to geoand/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to geoand/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to gsmet/quarkus by galderz 3 years ago
- Only use `objcopy` in Linux environments #13856 * `objcopy` invocations in macOS make the executable crash on startup. * Debug info is only available for Linux, so avoid `objcopy` altogether on macOS... — committed to gsmet/quarkus by galderz 3 years ago
@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 defaultPATHand only bring it into PATH when you really need it.@patped I’m looking into it 😃
After running
objcopy --strip-debugon Hello World binary I get Killed: 9 too