Tuesday, February 22, 2022

[SOLVED] Segmentation fault running a goldfish kernel under emulator

Issue

im using

OS: ubuntu 18.04
toolchain: x86_64-linux-android-4.9
emulator: Android emulator version 27.3.9.0

i did the things below for kernel versions 3.14, 3.18, 4.4 compilation succeeded for all with a few warnings...

git clone https://android.googlesource.com/kernel/goldfish/ -b android-goldfish-X.XX
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
cd goldfish
export CROSS_COMPILE=x86_64-linux-android-
export ARCH=x86_64
export PATH=$PATH:/path/to/x86_64-linux-android-4.9/bin
make x86_64_ranchu_defconfig
make menuconfig  # enable overlayfs and namespaces support here
make -j8

i copied the kernels onto another folder for ease of access my troubles began when i tried to boot the kernel i tried to boot each of the kernels i compiled

./avdmanager create avd --name test0 --package "system-images;android-24;default;x86_64"
sudo ./emulator -avd test0 -kernel /home/sandbox/.android/android_kernel/kernels/bzImage -show-kernel

this is the log

https://shrib.com/#mascot

long story short a segment fault is all i see repeated over and over again

segfault at fff07000 ip 00000000ef0fb480 sp 00000000fff25da0 error 4 in libart.so[eebd6000+71d000]

note everything is stock nothing was changed not even the configuration if i am able to do this ill proceed to loadable kernel modules


Solution

for goldfish 3.10 revert the following commits and it will work fine https://android-review.googlesource.com/q/topic:%22fixemulatorcrash%22+(status:open%20OR%20status:merged)



Answered By - K142094
Answer Checked By - Clifford M. (WPSolving Volunteer)