llvm70 ninja error: "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" at file "AArch64InstPrinter.cpp"

1,613 views
Skip to first unread message

DANiO

unread,
Sep 16, 2018, 12:29:12 PM9/16/18
to Android-x86
hi, i've error with llvm70 on android-x86 oreo-x86 branch with this error as topic says...
i'm also building on aws vps and the same error.
---
here i give the error LOG.

greetings

fguy

unread,
Sep 16, 2018, 1:31:36 PM9/16/18
to Android-x86
To build the android 8 and 9, I used this branch from Maurossi https://github.com/maurossi/llvm/tree/oreo-x86_llvm70 .
With it, there are no problems with the assembly, except for two - it takes a long time (1.5 hours) and space (+40 GB). 

DANiO

unread,
Sep 16, 2018, 3:10:25 PM9/16/18
to Android-x86
Thanks! it seems to compile the android.

Mauro Rossi

unread,
Sep 16, 2018, 4:22:19 PM9/16/18
to Android-x86
Hi DANio,

It is an "out of memory error", nothing to do with codebase build errors,
when it happens to me, I kill the java process using 6 Gbytes and I restart the build,
try also to avoid launching browsers, they allocate lots of memory.

The additional time and space mentioned by fguy is because new mesa requires updated llvm for radeonsi to work.
(there are two llvm projects now)
and AMD radeonsi, amdgpu (and upcoming radv) would not work without, so it is worth the additional space, uh?

I would not recomment to use the Android.mk (kati based) branch mentioned by fguy,
because Android.bp (soong) is much more efficient and quick in both build and rebuilds.

Just sync oreo-x86 repo, which was published after many test, I can assure you.
Mauro

Guneet Atwal

unread,
Sep 17, 2018, 10:34:17 AM9/17/18
to andro...@googlegroups.com
can you provide a branch for nougat-x86 as well ?

--
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.
For more options, visit https://groups.google.com/d/optout.

Mauro Rossi

unread,
Sep 17, 2018, 1:08:37 PM9/17/18
to Android-x86


Il giorno lunedì 17 settembre 2018 16:34:17 UTC+2, zjaro ha scritto:
can you provide a branch for nougat-x86 as well ?

For nougat-x86 which does not support Android.bp
you may try with these branches which are still based on Android.mk (kati build):

https://github.com/maurossi/llvm/tree/nougat-x86_llvm60 (this was tested in building nougat-x86, but many months ago, mesa changes required in main Android.mk but replacing 70 with 60)

https://github.com/maurossi/llvm/tree/oreo-x86_llvm70_release_70 (I built with this yesterday, but I have not tested it)

drm_gralloc and libdrm of oreo-x86 branch are required for building nougat-x86 with updated mesa 18.2.0, just fetch and checkout x86 oreo-x86 for those projects.

Please consider that if your goal is use android-x86 with recent AMD GPUs recent kernel will be required,
the following one has amdgpudrmfb used as default instead of radeondrmfb for SI, CIK parts:

Mauro


sr4sh...@gmail.com

unread,
Sep 20, 2018, 6:37:22 AM9/20/18
to Android-x86
Hi Mauro Rossi,

Thank you for the suggestion.

I just downloaded below projects from android-x86 oreo-x86 branch,

Mesa 18.2.0 
libdrm
drm_gralloc


I am integrated into android-x86 nougat code , the Compilation was successful. But getting only android shell, when i see the logcat, got the below errors

                       E GRALLOC-MOD: failed to add fb
                       E Gralloc1On0Adapter: gralloc0 allocation failed: -2 (No such file or directory)
                       E GraphicBufferAllocator: Failed to allocate (1920 x 1080) format 2 usage 6656: 5
                       D GraphicBufferAllocator: Allocated buffers:
                       D GraphicBufferAllocator: Total allocated (estimate): 0.00 KB
                       E         : GraphicBufferAlloc::createGraphicBuffer(w=1920, h=1080) failed (Out of memory), handle=0x0
                       E BufferQueueProducer: [FramebufferSurface] allocateBuffers: failed to allocate buffer (0 x 0, format 2, usage 0)


Getting  ServiceManager: Waiting for service SurfaceFlinger... continuously.

Thanks,

Srihari Babu Rāvi

unread,
Sep 20, 2018, 7:03:41 AM9/20/18
to andro...@googlegroups.com
What platform you are using?

sr4sh...@gmail.com

unread,
Sep 20, 2018, 7:23:08 AM9/20/18
to Android-x86
AMD Gigbyte with Ryzen with 4.16 kernel.

Mauro Rossi

unread,
Sep 20, 2018, 1:55:49 PM9/20/18
to Android-x86
Hi,


Il giorno giovedì 20 settembre 2018 12:37:22 UTC+2, sr4sh...@gmail.com ha scritto:
Hi Mauro Rossi,

Thank you for the suggestion.

I just downloaded below projects from android-x86 oreo-x86 branch,

Mesa 18.2.0 
libdrm
drm_gralloc


I am integrated into android-x86 nougat code , the Compilation was successful. But getting only android shell, when i see the logcat, got the below errors

                       E GRALLOC-MOD: failed to add fb
                       E Gralloc1On0Adapter: gralloc0 allocation failed: -2 (No such file or directory)
                       E GraphicBufferAllocator: Failed to allocate (1920 x 1080) format 2 usage 6656: 5
                       D GraphicBufferAllocator: Allocated buffers:
                       D GraphicBufferAllocator: Total allocated (estimate): 0.00 KB
                       E         : GraphicBufferAlloc::createGraphicBuffer(w=1920, h=1080) failed (Out of memory), handle=0x0
                       E BufferQueueProducer: [FramebufferSurface] allocateBuffers: failed to allocate buffer (0 x 0, format 2, usage 0)


Getting  ServiceManager: Waiting for service SurfaceFlinger... continuously.

Thanks,

Mesa 18.2 requires to set BOARD_USES_DRM_GRALLOC in device/generic/common/BoardConfig.mk


Mauro

Din Assegaf

unread,
May 25, 2019, 7:23:32 AM5/25/19
to Android-x86
llvm70 ninja error: "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" at file "AArch64InstPrinter.cpp"

I got the same error external/llvm70/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp

[  0% 27/18354] //external/llvm70/lib/Target/AArch64/InstPrinter:libLLVM70AArch64AsmPrinter clang++ AArch64InstPrinter.cpp [x86]
FAILED: out/soong/.intermediates/external/llvm70/lib/Target/AArch64/InstPrinter/libLLVM70AArch64AsmPrinter/android_x86_x86_64_static_core/obj/external/llvm70/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.o 
PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++ -c -Iexternal/llvm70/lib/Target/AArch64/InstPrinter  -fno-exceptions -Wno-multichar -O2 -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -ffunction-sections -fno-short-enums -fstrict-aliasing -funwind-tables -fstack-protector-strong -no-canonical-prefixes -O2 -g -fno-strict-aliasing -msse3 -mstackrealign -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -m32 -march=prescott -DUSE_SSSE3 -mssse3 -msse4 -msse4.1 -msse4.2 -Iexternal/llvm70/include -Iexternal/llvm70/device/include -Iout/soong/.intermediates/external/llvm70/llvm70-gen-attributes/gen -Iout/soong/.intermediates/external/llvm70/llvm70-gen-intrinsics/gen -Iout/soong/.intermediates/external/llvm70/llvm70-gen-revision/gen -Iexternal/llvm70/lib/Target/AArch64 -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Iout/soong/.intermediates/external/llvm70/lib/Target/AArch64/llvm70-gen-aarch64/gen -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/arch-x86/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-x86 -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_deprecated -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -fomit-frame-pointer -Wall -W -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Werror -Dsprintf=sprintf -Wno-error=unused-lambda-capture -Wno-error=user-defined-warnings -target i686-linux-android -Bprebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin -fPIC -D_USING_LIBCXX -std=gnu++14 -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-sign-promo -std=c++11 -Woverloaded-virtual -fno-rtti  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF out/soong/.intermediates/external/llvm70/lib/Target/AArch64/InstPrinter/libLLVM70AArch64AsmPrinter/android_x86_x86_64_static_core/obj/external/llvm70/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.o.d -o out/soong/.intermediates/external/llvm70/lib/Target/AArch64/InstPrinter/libLLVM70AArch64AsmPrinter/android_x86_x86_64_static_core/obj/external/llvm70/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.o external/llvm70/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
clang++.real: error: unable to execute command: Aborted (core dumped)
clang++.real: error: clang frontend command failed due to signal (use -v to see invocation)
Android clang version 5.0.300080  (based on LLVM 5.0.300080)
Target: i686--linux-android
Thread model: posix


is there any fix to this ? except download those Maurossi build. I already use the space too much, maybe a single fix will be enough rather than download new build

Mauro Rossi

unread,
May 25, 2019, 6:40:20 PM5/25/19
to Android-x86
Hi,


On Saturday, May 25, 2019 at 1:23:32 PM UTC+2, Din Assegaf wrote:
llvm70 ninja error: "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" at file "AArch64InstPrinter.cpp"


It is basically an out of memory error,
in order to avoid it yo need to increase equipped memory or build with less concurrent jobs

Mauro

Din Assegaf

unread,
May 27, 2019, 9:18:12 AM5/27/19
to andro...@googlegroups.com
You are right , its working once we close another eat memory apps (as always the google-chrome)

Deen

Reply all
Reply to author
Forward
0 new messages