ISO Build Failure - Clang Segmentation Fault

194 views
Skip to first unread message

BrokenE39

unread,
Jun 15, 2019, 6:00:42 PM6/15/19
to Android-x86
I'm pretty stump by this problem that showed up when I'm trying to build new ISO images of Oreo 8.1. The Linux VM was working fine a few days ago but all the sudden started to throw errors during the build process.

clang++.real: error: unable to execute command: Segmentation fault (core dumped)
clang++.real: error: clang frontend command failed due to signal (use -v to see invocation)

The complete error message is way too big to paste so I included a log file, please see Google drive link.


1. Re-sync the repo
2. Re-install the required packages for Ubuntu 14.04

There were no other changes to my VM or host machine so I'm not sure why it suddenly stop working.

BrokenE39

unread,
Jun 17, 2019, 11:37:22 PM6/17/19
to Android-x86
An update on my situation. The problem isn't solved after I rebuild my VM using Ubuntu 14.04. Now the error log is showing clang++ bus error. My VM specs as follow:

250GB of space total for the VM
242GB for sda1 (boot)
7.85GB for sda2 (swap)
18GB of RAM
6 cores assigned

I don't think I'm running out of room so the only thing I can think of is memory problem (bad RAM) or a HDD issue. Anyone else ran into this problem before with their build VM?

Jon West

unread,
Jun 18, 2019, 7:29:10 PM6/18/19
to Android-x86
With Ubuntu 14.04 being used, I'm almost thinking it could be something like the clang version you have installed, or another dependency like that. I would look into the required dependencies first. 
For example, here are all the packages I initiate my environment with:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386  lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip squashfs-tools python-mako libssl-dev ninja-build lunzip syslinux syslinux-utils gettext genisoimage gettext bc xorriso

Jon West

unread,
Jun 18, 2019, 7:31:06 PM6/18/19
to Android-x86
You want to also make sure that the clang version being used is the one AOSP/Android-x86 is using in the manifest. Any conflicting defaults could cause issues.

Daniel Cheung

unread,
Jun 18, 2019, 9:29:16 PM6/18/19
to andro...@googlegroups.com
Interesting that when I ran "clang -version" it came back as not installed. This doesn't make sense because the last build that I did was back on June 11th and it didn't throw any clang related error messages. I also tried to install the dependency packages but Ubuntu 14.04 is complaining it can't find syslinux-utils. Also, which manifest do I check for the required clang version?

On Tue, Jun 18, 2019 at 4:31 PM Jon West <electr...@gmail.com> wrote:
You want to also make sure that the clang version being used is the one AOSP/Android-x86 is using in the manifest. Any conflicting defaults could cause issues.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/8d5c5efa-3a00-4630-bf51-05b8b6a5084c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chih-Wei Huang

unread,
Jun 18, 2019, 10:28:30 PM6/18/19
to Android-x86
Daniel Cheung <dwt.c...@gmail.com> 於 2019年6月19日 週三 上午9:29寫道:
>
> Interesting that when I ran "clang -version" it came back as not installed. This doesn't make sense because the last build that I did was back on June 11th and it didn't throw any clang related error messages. I also tried to install the dependency packages but Ubuntu 14.04 is complaining it can't find syslinux-utils. Also, which manifest do I check for the required clang version?

You don't need to install clang.
The whole prebuilt toolchain to compile AOSP / Android-x86
are in the source tree. It's not in the normal PATH so
you can't invoke it directly. The build system knows
how to invoke it, of course.

Daniel Cheung

unread,
Jun 18, 2019, 11:10:44 PM6/18/19
to andro...@googlegroups.com
That's what I thought since it didn't have a problem before since I started building with 7.1 a year ago. That still leave me with the question of why it's suddenly throwing errors. The hard drive where the VM image is located was tested last night with no issue and I just updated Virtual Box to the latest version but still getting clang issues. I'll run a memory test tomorrow just in case.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

김윤아

unread,
Jun 19, 2019, 5:14:35 AM6/19/19
to Android-x86
I have a question.

After building the kernel, what should I put in to apply the changed kernel?
Please tell me in great detail.

Daniel Cheung

unread,
Jun 20, 2019, 1:59:14 AM6/20/19
to andro...@googlegroups.com
A quick update on my situation. It looks like the update to Virtual Box wasn't installed correctly. Once installed and verified, I then switch the VM's chipset to PIIX3. Another attempt to build the ISO of 8.1 R2 was successful with no clang error being thrown. So I'm going to classify this as a VM issue.

As for kks' question about the kernel. If I remember correctly, you need to copy the kernel file to a USB containing an Android X86 live USB and then boot the USB in live / demo mode. You then copy the kernel over to the computer to replace it. I suggestion you boot from the Live USB first and see if you can even inspect the computer's hard drive to see if you have access to its content.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

김윤아

unread,
Jun 20, 2019, 2:50:50 AM6/20/19
to Android-x86
I replaced the new kernel file in booting usb.
I installed new android x86.
but I can't connect to the Internet.

I checked the dmesg and not found a ethernet.

I simply replaced the new kernel file.
I changed evdev.c, mousedev.c, joydev.c.

The remaining settings were not touched.

My goal is to patch evdev.c, mousedev.c and joydev.c as modified in stable android-x86-64 8.1 r2 iso.

But I don't know the kernel so much that it's too hard.

Someone ask for a guide in detail.


Daniel Cheung

unread,
Jun 20, 2019, 3:35:36 AM6/20/19
to andro...@googlegroups.com
I suggest you try compiling a new ISO instead. Can you link me to your original post since we're now talking about things not relating to this thread. I can continue to post there.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

김윤아

unread,
Jun 20, 2019, 5:46:27 AM6/20/19
to Android-x86
I try compiling a new ISO.

But I met "Clang segmentation Fault" like you...

I read and try writing aboud clang on the Internet, but it still stops at the same place.

Please tell me how to fix it.

Daniel Cheung

unread,
Jun 20, 2019, 3:57:13 PM6/20/19
to andro...@googlegroups.com
Oh sorry, I thought you were having issues other than Clang Segmentation issue. I don't know exactly why my virtual machine was giving me different types of Clang errors. As you have seen, the only thing that fixed it was to update Virtual Box host application and changing the chipset. From what I read online and what Chih-Wei said, you don't need to worry about clang version or installing clang since it's included as part of the source code. Now, tell me about the build environment you're using.

Are you using a virtual machine environment?
Are you using the recommended OS and packages as recommended on the AOSP Build Environment web page?
Have you tested your system for issues such as hard drive faults and memory faults?

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

김윤아

unread,
Jun 20, 2019, 5:14:30 PM6/20/19
to Android-x86
<Machine>
Lenovo IdeaCentre IC510-BKR
RAM - 8GB
HDD : 128GB Nvme SSD M.2 2280 PCIe
LAN : 1000Mbps LAN

I installed Ubuntu 18.04 on the machine.


shell> sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip


shell> sudo apt -y install git gcc curl make repo xmllint flex m4

They say it cannot be installed because of xmllint.

shell> sudo apt -y install git gcc curl make repo flex m4
shell> sudo apt -y install openjdk-8-jdk lib32stdc++6 libelf-dev
shell> sudo apt -y install libssl-dev python-mako syslinux-utils
shell> mkdir android-x86
shell> cd android-x86
shell> repo init -u git://git.osdn.net/gitroot/android-x86/manifest -b oreo-x86 -m android-x86-8.1-r2.xml
shell> repo sync --no-tags --no-clone-bundle

When the download is complete, modify three files(evdev.c, mousedev.c, joydev.c) for the touchscreen.

shell> source build/envsetup.sh
shell> lunch android_x86_64-userdebug
shell> m -j4 iso_img

It stops when the "Clang Segmentation Fault" is released at 82%.

So I tried to build only kernel.

shell> rm -rf out
shell> source build/envsetup.sh
shell> lunch android_x86_64-userdebug
shell> make kernel

A kernel is created.

When you replace the out/target/product/x86_64/kernel file with the kernel file in the iso file, the touchscreen screen will operate but the network will not work.

Perhaps you can do so by creating a kernel without setting up android_x86_64_defconfig.

But I also don't know how to address the settings in android_x86_64_defconfig.

If you install android-x86_64-8.1-r2.iso that you downloaded from the website, it works well except for the touchscreen. I inquired of the touchscreen manufacturer and told him that I have to patch the kernel.
I've built the Android kernel for the first time. I don't know what's wrong.






Daniel Cheung

unread,
Jun 20, 2019, 9:20:50 PM6/20/19
to andro...@googlegroups.com
1. You may not have enough memory. I use 18GB with my VM as a minimum of 16 is needed. Read this link where they try to build 7.x using 8GB of RAM.

2. When you call the make kernel command, you are not telling it which kernel config to use. You should make your own kernel config file first then tell make to use it. Here's how I do it:

a. Go to /(android source)/kernel/arch/config/x86 folder
b. Make a copy of android_x86_64_defconfig and name it .config
c. Make sure you know the hardware specs of your device such as wifi model, touch screen, CPU, GPU
d. Modify the kernel config, I have my code in a bash file:

#!/bin/bash
. build/envsetup.sh
export ARCH=x86_64
lunch android_x86_64-userdebug
sudo make -C kernel O=/home/daniel/android_8/kernel/arch/x86/configs/ xconfig

e. Make as little changes as possible and make sure you select driver options that match your device hardware.
f. Save the file and then make a copy of it and rename it to something else, I use "my_defconfig"
g. Make the kernel or ISO file, I have my code in a base file:

#!/bin/bash
. build/envsetup.sh
export LC_ALL=C
#sudo make clean
lunch android_x86_64-userdebug
make -j6 iso_img TARGET_KERNEL_CONFIG=my_defconfig

I'm not sure if you can just make a new kernel and copy the .c files over to make the changes. I never tried to build new drivers for my device and I usually make a new image every time.


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

Chih-Wei Huang

unread,
Jun 20, 2019, 11:06:40 PM6/20/19
to Android-x86
Daniel Cheung <dwt.c...@gmail.com> 於 2019年6月21日 週五 上午9:20寫道:

>
> 1. You may not have enough memory. I use 18GB with my VM as a minimum of 16 is needed. Read this link where they try to build 7.x using 8GB of RAM.
> http://www.2net.co.uk/blog/jack-server.html
>
> 2. When you call the make kernel command, you are not telling it which kernel config to use.

The 'make kernel' command was documented in
https://www.android-x86.org/documentation/customize_kernel.html

It uses the default kernel config of the lunched target.
(e.g., kernel/arch/config/x86/android_x86_64_defconfig for 64-bit target)

However, there is a flaw in the command.
It just installs $OUT/kernel without installing the modules.
I've phased in a fix. Please do

repo sync device/generic/common
make kernel

Then copy all $OUT/system/lib/modules/ to
/system/lib/modules of your target device.
(your /system must be installed as read-write mode)

You should make your own kernel config file first then tell make to
use it. Here's how I do it:
>
> a. Go to /(android source)/kernel/arch/config/x86 folder
> b. Make a copy of android_x86_64_defconfig and name it .config
> c. Make sure you know the hardware specs of your device such as wifi model, touch screen, CPU, GPU
> d. Modify the kernel config, I have my code in a bash file:
>
> #!/bin/bash
> . build/envsetup.sh
> export ARCH=x86_64
> lunch android_x86_64-userdebug
> sudo make -C kernel O=/home/daniel/android_8/kernel/arch/x86/configs/ xconfig
>
> e. Make as little changes as possible and make sure you select driver options that match your device hardware.
> f. Save the file and then make a copy of it and rename it to something else, I use "my_defconfig"
> g. Make the kernel or ISO file, I have my code in a base file:
>
> #!/bin/bash
> . build/envsetup.sh
> export LC_ALL=C
> #sudo make clean
> lunch android_x86_64-userdebug
> make -j6 iso_img TARGET_KERNEL_CONFIG=my_defconfig
>
> I'm not sure if you can just make a new kernel and copy the .c files over to make the changes. I never tried to build new drivers for my device and I usually make a new image every time.




--
Chih-Wei
Android-x86 project
http://www.android-x86.org

김윤아

unread,
Jun 21, 2019, 3:26:02 AM6/21/19
to Android-x86
The reason why iso was not made was because there was no space left in hdd.

Because Hdd capacity cannot be increased at present, it decided to make only kernel.

As I told you...

shell> source build/envsetup.sh
shell> repo sync device/generic/common 
shell> make kernel

However, there is no out/target/product/x86/system/lib/module you have given us.

So I copied the out/target/product/x86/system/lib folder to /system/lib.

Still, it didn't move.

Especially what I am curious about is that I did not touch android_x86_64_defconfig file and did.

Internet and graphics were recognized properly when it was installed as static iso, but if kernel is changed, graphics and resolution are not correct and internet is not possible.
 
I don't know how to set up the android_x86_64_defconfig file.

Could you attach the android_x86_64_defconfig file that you used to create android_x86_64.iso?

Chih-Wei Huang

unread,
Jun 21, 2019, 4:19:35 AM6/21/19
to Android-x86
김윤아 <kks...@gmail.com> 於 2019年6月21日 週五 下午3:26寫道:
>
> The reason why iso was not made was because there was no space left in hdd.
>
> Because Hdd capacity cannot be increased at present, it decided to make only kernel.
>
> As I told you...
>
> shell> source build/envsetup.sh
> shell> repo sync device/generic/common
> shell> make kernel
>
> However, there is no out/target/product/x86/system/lib/module you have given us.

Which target did you lunch exactly?
For 64-bit target it's out/target/product/x86_64/system/lib/modules/
If this is not built, there is something wrong.
You have to figure it out and fix it.

To force rebuild the kernel, do

rm $OUT/obj/kernel/.config

then make kernel again.
Also ensure you have enough disk space to build it.

> So I copied the out/target/product/x86/system/lib folder to /system/lib.
>
> Still, it didn't move.
>
> Especially what I am curious about is that I did not touch android_x86_64_defconfig file and did.
>
> Internet and graphics were recognized properly when it was installed as static iso, but if kernel is changed, graphics and resolution are not correct and internet is not possible.
>
> I don't know how to set up the android_x86_64_defconfig file.
>
> Could you attach the android_x86_64_defconfig file that you used to create android_x86_64.iso?

Read
https://www.android-x86.org/documentation/customize_kernel.html

김윤아

unread,
Jun 24, 2019, 7:22:18 PM6/24/19
to Android-x86
Building a kernel will prevent system/lib/modules. However, if the ISO fails, it is made.

So I copied the ISO from the failed place to the system/lib/modules.

But ethernet doesn't work. Even the wifi doesn't turn on.

No settings have been touched.

What settings does ethernet work?
Reply all
Reply to author
Forward
0 new messages