基于 Ubuntu 18.04 的 AOSP 版本 11 失败(出现段错误)
AOSP version 11 build on Ubuntu 18.04 failed (getting segfaults)
我尝试使用以下命令构建 AOSP:
repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r27
repo sync
. build/envsetup.sh
lunch aosp_x86_64-eng
make -j8
它运行了大约 1.5 小时才出错。这是我在日志中看到的内容:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=aosp_x86_64
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-67-generic-x86_64-Ubuntu-18.04.5-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ1A.210105.003
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera device/generic/goldfish device/generic/goldfish-opengl
============================================
ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
No need to regenerate ninja file
No need to regenerate ninja file
Starting ninja...
[ 0% 1/4863] //external/apache-xml:apache-xml javac [common com.android.art.debug]
FAILED: out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar
rm -rf "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars" && mkdir -p "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars" && out/soong/host/linux-x86/bin/zipsync -d out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars -l out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list -f "*.java" && (if [ -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list ] || [ -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar.rsp ] ; then out/soong/host/linux-x86/bin/soong_javac_wrapper prebuilts/jdk/jdk11/linux-x86/bin/javac -J-Xmx2048M -J-XX:OnError="cat hs_err_pid%p.log" -J-XX:CICompilerCount=6 -J-XX:+UseDynamicNumberOfGCThreads -Xmaxerrs 9999999 -encoding UTF-8 -sourcepath "" -g -XDskipDuplicateBridges=true -XDstringConcat=inline -proc:none -Xlint:-dep-ann --system=out/soong/.intermediates/libcore/core-all-system-modules/android_common/system -source 1.9 -target 1.9 -d out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno @out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar.rsp @out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list ; fi ) && out/soong/host/linux-x86/bin/soong_zip -jar -o out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar -C out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes -D out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes && rm -rf "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars"
external/apache-xml/src/main/java/org/apache/xalan/extensions/ExpressionContext.java:23: error: package javax.xml.transform is not visible
import javax.xml.transform.ErrorListener;
^
(package javax.xml.transform is declared in module java.base, which does not export it)
external/apache-xml/src/main/java/org/apache/xalan/extensions/ExpressionContext.java:26: error: package org.w3c.dom is not visible
import org.w3c.dom.Node;
^
...
...
它显示了一长串导入错误,就像上面两个一样...
和
build/soong/scripts/jars-to-module-info-java.sh: line 29: 33922 Segmentation fault (core dumped) zipinfo -1 $j
这是 shell 脚本:
if [ -z "" ]; then
echo "usage: [=14=] <module name> <jar1> [<jar2> ...]" >&2
exit 1
fi
module_name=
shift
echo "module ${module_name} {"
for j in "$@"; do zipinfo -1 $j ; done \ # this is the line that segfaults
| grep -E '/[^/]*\.class$' \
| sed 's|\(.*\)/[^/]*\.class$| exports ;|g' \
| sed 's|/|.|g' \
| sort -u
echo "}"
我的系统有 64 GB 的 RAM,我尝试降低 j 值但得到相同的结果。回购同步成功。
我不是 S/O 的常客,但我花了很多时间为某人解决这个特殊问题,所以我认为如果我能为您提供我的解决方案就太好了。
zipinfo 可能会崩溃,因为在 /usr/local 中安装了一个名为 libAppProtection 的预加载库,在 AOSP 构建强加的条件下崩溃。我已经找到了解决此特定问题的解决方法,但如果问题的原因与我遇到的相同,那么您将遇到其他找不到解决方法的问题。
GDB stacktrace of 'fec' another program crashing the same way
在 中描述该库与 Citrix Workspace App SDK.
有关
如果您观察到我在使用 GDB 运行 zipinfo 或 fec 时所做的相同事情,我只能建议您在处理构建 AOSP 源代码时删除此程序。我知道这行之有效,并且没有给客户带来任何不利影响。也许只是禁用 /etc/ld.so.preload 中的预加载库会起作用,但我没有尝试过,因为我对 Citrix 一无所知,我会建议反对这样做。
我尝试使用以下命令构建 AOSP:
repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r27
repo sync
. build/envsetup.sh
lunch aosp_x86_64-eng
make -j8
它运行了大约 1.5 小时才出错。这是我在日志中看到的内容:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=aosp_x86_64
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-67-generic-x86_64-Ubuntu-18.04.5-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ1A.210105.003
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera device/generic/goldfish device/generic/goldfish-opengl
============================================
ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
No need to regenerate ninja file
No need to regenerate ninja file
Starting ninja...
[ 0% 1/4863] //external/apache-xml:apache-xml javac [common com.android.art.debug]
FAILED: out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar
rm -rf "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars" && mkdir -p "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno" "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars" && out/soong/host/linux-x86/bin/zipsync -d out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars -l out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list -f "*.java" && (if [ -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list ] || [ -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar.rsp ] ; then out/soong/host/linux-x86/bin/soong_javac_wrapper prebuilts/jdk/jdk11/linux-x86/bin/javac -J-Xmx2048M -J-XX:OnError="cat hs_err_pid%p.log" -J-XX:CICompilerCount=6 -J-XX:+UseDynamicNumberOfGCThreads -Xmaxerrs 9999999 -encoding UTF-8 -sourcepath "" -g -XDskipDuplicateBridges=true -XDstringConcat=inline -proc:none -Xlint:-dep-ann --system=out/soong/.intermediates/libcore/core-all-system-modules/android_common/system -source 1.9 -target 1.9 -d out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes -s out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/anno @out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar.rsp @out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars/list ; fi ) && out/soong/host/linux-x86/bin/soong_zip -jar -o out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/apache-xml.jar -C out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes -D out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/classes && rm -rf "out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/javac/srcjars"
external/apache-xml/src/main/java/org/apache/xalan/extensions/ExpressionContext.java:23: error: package javax.xml.transform is not visible
import javax.xml.transform.ErrorListener;
^
(package javax.xml.transform is declared in module java.base, which does not export it)
external/apache-xml/src/main/java/org/apache/xalan/extensions/ExpressionContext.java:26: error: package org.w3c.dom is not visible
import org.w3c.dom.Node;
^
...
...
它显示了一长串导入错误,就像上面两个一样...
和
build/soong/scripts/jars-to-module-info-java.sh: line 29: 33922 Segmentation fault (core dumped) zipinfo -1 $j
这是 shell 脚本:
if [ -z "" ]; then
echo "usage: [=14=] <module name> <jar1> [<jar2> ...]" >&2
exit 1
fi
module_name=
shift
echo "module ${module_name} {"
for j in "$@"; do zipinfo -1 $j ; done \ # this is the line that segfaults
| grep -E '/[^/]*\.class$' \
| sed 's|\(.*\)/[^/]*\.class$| exports ;|g' \
| sed 's|/|.|g' \
| sort -u
echo "}"
我的系统有 64 GB 的 RAM,我尝试降低 j 值但得到相同的结果。回购同步成功。
我不是 S/O 的常客,但我花了很多时间为某人解决这个特殊问题,所以我认为如果我能为您提供我的解决方案就太好了。
zipinfo 可能会崩溃,因为在 /usr/local 中安装了一个名为 libAppProtection 的预加载库,在 AOSP 构建强加的条件下崩溃。我已经找到了解决此特定问题的解决方法,但如果问题的原因与我遇到的相同,那么您将遇到其他找不到解决方法的问题。
GDB stacktrace of 'fec' another program crashing the same way
在
如果您观察到我在使用 GDB 运行 zipinfo 或 fec 时所做的相同事情,我只能建议您在处理构建 AOSP 源代码时删除此程序。我知道这行之有效,并且没有给客户带来任何不利影响。也许只是禁用 /etc/ld.so.preload 中的预加载库会起作用,但我没有尝试过,因为我对 Citrix 一无所知,我会建议反对这样做。