Repository navigation
Open
Labels
Description
Hello,
When I use CodeQL to create database, I got following error:
% codeql database create tdb --language=java
Initializing database at /Users/admin/Documents/codeql-home/repo/xxx/java-db.
Running build command: [/Users/admin/Documents/codeql-home/codeql/java/tools/autobuild.sh]
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] Build directory is .
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] [autobuild] > mvn clean package -f "pom.xml" -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] [ERROR] Spawned process exited abnormally (code 134; tried to run: [mvn, clean, package, -f, pom.xml, -B, -V, -e, -Dfindbugs.skip, -Dcheckstyle.skip, -Dpmd.skip=true, -Denforcer.skip, -Dmaven.javadoc.skip, -DskipTests, -Dmaven.test.skip.exec, -Dlicense.skip=true, -Drat.skip=true])
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] [autobuild] dyld: could not load inserted library '/Users/admin/Documents/codeql-home/codeql/tools/osx64/libtrace.dylib' because no suitable image found. Did find:
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] [autobuild] /Users/admin/Documents/codeql-home/codeql/tools/osx64/libtrace.dylib: no matching architecture in universal wrapper
[2022-01-26 21:17:40] [build-stdout] [2022-01-26 21:17:40] [autobuild] /Users/admin/Documents/codeql-home/codeql/tools/osx64/libtrace.dylib: stat() failed with errno=1
[2022-01-26 21:17:40] [ERROR] Spawned process exited abnormally (code 134; tried to run: [/Users/admin/Documents/codeql-home/codeql/tools/osx64/preload_tracer, /Users/admin/Documents/codeql-home/codeql/java/tools/autobuild.sh])
A fatal error occurred: Exit status 134 from command: [/Users/admin/Documents/codeql-home/codeql/java/tools/autobuild.sh]Version:
- codeql-cli: 2.7.6 (> 2.7.3 Tracing fails for Java builds on Mac M1 #101 )
- java: 17.0.1
- mvn: 3.8.4
- macOS: Big Sur (11.6) on M1, 2020
I changed CodeQL to Ubuntu ARM64 virtual machine (Using UTM), then the error changed to: java: Exec format error
And then I use an old macbook, finally success.
So I think the problem is M1. Can I do something to resolve this problem?
Activity
aibaars commentedon Jan 31, 2022
Thanks for reporting this. The error message on Ubuntu ARM is expected. CodeQL only supports arm64 for OSX at the moment.
We tried the 2.7.6 version of CodeQL on macOS 12 (Monterey) with a simple mvn build and things work fine. Perhaps the way we generate the universal binary somehow does not work on macOS: Big Sur (11.6) .
To debug things further, could you:
codeql versionto double check you got the most recent versionfile /Users/admin/Documents/codeql-home/codeql/tools/osx64/libtrace.dylibto check which architectures the library containstdb/log/build-tracer.logfor clues of what might be going wrong. You can also share the entire file if you wish; however, it can be quite large and may contain sensitive file names etc you might not want to share in a public issue.alioth310 commentedon Feb 7, 2022
codeql version:file libtrace.dylib:codeql database createcommand, and the following is the content ofbuild-tracer.logfile.aibaars commentedon Feb 7, 2022
Many thanks for the detailed report. I'll pass this on to the team.
safe6Sec commentedon Feb 14, 2023
@aibaars Is this problem solved?