Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 540960 - media-libs/mesa-10.3.7-r1 - powerpc-unknown-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Summary: media-libs/mesa-10.3.7-r1 - powerpc-unknown-linux-gnu-gcc: internal compiler ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: PPC Linux
: Normal major (vote)
Assignee: Matt Turner
URL:
Whiteboard:
Keywords: Bug, EBUILD
Depends on:
Blocks:
 
Reported: 2015-02-22 02:37 UTC by Scott Goedeke
Modified: 2015-03-01 19:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output of `emerge --info '=media-libs/mesa-10.3.7-r1::gentoo' (bugemergeInfo,4.88 KB, text/plain)
2015-02-22 02:37 UTC, Scott Goedeke
Details
the output of `emerge -pqv '=media-libs/mesa-10.3.7-r1::gentoo'` (bugemerge-pqv,367 bytes, text/plain)
2015-02-22 02:40 UTC, Scott Goedeke
Details
Build log, as announced in my comment. (build.log,443.32 KB, text/plain)
2015-02-22 07:41 UTC, Paul Osmialowski
Details
patch (0001-mesa-break-up-_mesa_swizzle_and_convert-to-reduce-co.patch,34.02 KB, patch)
2015-02-28 17:45 UTC, Matt Turner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Goedeke 2015-02-22 02:37:07 UTC
Created attachment 397174 [details]
output of `emerge --info '=media-libs/mesa-10.3.7-r1::gentoo'

On the 32nd of 47 packages the "emerge --ask --update --deep --with-bdeps=y @world" failed and quit on emerging mesa-10.3.7-r1 with the following message:

cc1: out of memory allocating 1124932 bytes after a total of 93609984 bytes
../../libtool: fork: Cannot allocate memory
Makefile:3825: recipe for target 'st_vdpau.lo' failed
gmake[4]: *** [st_vdpau.lo] Error 254
gmake[4]: *** Waiting for unfinished jobs....
Makefile:2257: recipe for target 'format_utils.lo' failed
gmake[4]: *** [format_utils.lo] Error 1
gmake[4]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:3966: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:1400: recipe for target 'all' failed
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:517: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src'
Makefile:585: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
 * ERROR: media-libs/mesa-10.3.7-r1::gentoo failed (compile phase):
 *   emake failed 

Tried again "emerge --ask --update --deep --with-bdeps=y @world", but got this message: 
powerpc-unknown-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
Makefile:2257: recipe for target 'format_utils.lo' failed
gmake[4]: *** [format_utils.lo] Error 1
gmake[4]: *** Waiting for unfinished jobs....
gmake[4]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:3966: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:1400: recipe for target 'all' failed
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:517: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src'
Makefile:585: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
 * ERROR: media-libs/mesa-10.3.7-r1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/mesa-10.3.7-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/mesa-10.3.7-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/mesa-10.3.7-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/mesa-10.3.7-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc'
 * S: '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7'

>>> Failed to emerge media-libs/mesa-10.3.7-r1, Log file:

>>>  '/var/tmp/portage/media-libs/mesa-10.3.7-r1/temp/build.log'

 * Messages for package media-libs/mesa-10.3.7-r1:

 * ERROR: media-libs/mesa-10.3.7-r1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/mesa-10.3.7-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/mesa-10.3.7-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/mesa-10.3.7-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/mesa-10.3.7-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc'
 * S: '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7'

Refer to forum thread: https://forums.gentoo.org/viewtopic-t-1011310.html
see attachments
Comment 1 Scott Goedeke 2015-02-22 02:40:32 UTC
Created attachment 397176 [details]
the output of `emerge -pqv '=media-libs/mesa-10.3.7-r1::gentoo'`
Comment 2 Paul Osmialowski 2015-02-22 07:34:50 UTC
The same architecture, the same mesa version, but different compiler problem at build time:

libtool: compile:  powerpc-unknown-linux-gnu-gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"10.3.7\" "-DPACKAGE_STRING=\"Mesa 10.3.7\"" "-DP
ACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"10.3.7\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYP
ES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN
_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD=1 -I. -DUSE_E
XTERNAL_DXTN_LIB=1 -D_GNU_SOURCE -DHAVE_PTHREAD -DTEXTURE_FLOAT_ENABLED -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DGLX_USE_DRM -DHAVE_LIBUDEV -DGLX_INDIRECT_RE
NDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_PTHREAD -DHAVE_ALIAS -DHAVE_DRI3 -DMESA_EGL_NO_X11_HEADERS -I../../include -I../../src -I../../src/glsl -I../../src/
glsl -I../../src/glsl/glcpp -I../../src/mesa -I../../src/mesa -I../../src/mesa/main -I../../src/mesa/main -I../../src/mapi -I../../src/mapi -I../../src/gallium/include
-I../../src/gallium/auxiliary -fvisibility=hidden -O2 -mcpu=powerpc -mtune=powerpc -fno-strict-aliasing -fomit-frame-pointer -pipe -Wall -std=c99 -Werror=implicit-funct
ion-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -c ../../src/mesa/main/format_utils.c  -fPIC -DPIC -o .libs/format_utils.o
{standard input}: Assembler messages:
{standard input}: Warning: end of file not at end of a line; newline inserted
{standard input}:895: Error: missing operand
{standard input}:895: Error: missing operand
{standard input}:895: Error: missing operand
powerpc-unknown-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
Makefile:2257: recipe for target 'format_utils.lo' failed
gmake[4]: *** [format_utils.lo] Error 1
gmake[4]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:3966: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:1400: recipe for target 'all' failed
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src/mesa'
Makefile:517: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.3.7-r1/work/Mesa-10.3.7-abi_ppc_32.ppc/src'
Makefile:585: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Compiler:
gcc (Gentoo 4.6.4 p1.2, pie-0.5.2) 4.6.4

This happens during update of mesa from 10.2.8 to 10.3.7-r1,

[ebuild     U  ] media-libs/mesa-10.3.7-r1 [10.2.8] USE="classic dri3 nptl osmesa pic udev -bindist -debug -egl -gallium -gbm -gles1 -gles2 -llvm (-opencl) (-openmax) -openvg -pax_kernel -r600-llvm-compiler (-selinux) (-vdpau) (-wayland) -xa (-xvmc)" VIDEO_CARDS="radeon (-freedreno) (-i915) (-i965) (-ilo) (-intel) -nouveau -r100 -r200 -r300 -r600 -radeonsi (-vmware)" 0 kB

I wonder if I should open new bug for this (since compiler error message is different), still the bottom line is: mesa-10.3.7-r1 is not for PPC and therfore should remain masked.
Comment 3 Paul Osmialowski 2015-02-22 07:38:37 UTC
Oh I did not notice "Tried again" part of your original message. Seems like we both hit the same error, though I pasted more relevant part. I'll attach whole build log soon.
Comment 4 Paul Osmialowski 2015-02-22 07:41:57 UTC
Created attachment 397178 [details]
Build log, as announced in my comment.
Comment 5 Paul Osmialowski 2015-02-22 10:12:23 UTC
I guess mystery is solved. Accidently, I looked at dmesgs and saw this:

[264622.198764] Out of memory: Kill process 22770 (cc1) score 618 or sacrifice child
[264622.198769] Killed process 22770 (cc1) total-vm:1299668kB, anon-rss:778212kB, file-rss:108kB

1GB RAM is not enough to build newer versions of mesa.
Comment 6 Anthony Basile gentoo-dev 2015-02-22 12:55:45 UTC
(In reply to Paul Osmialowski from comment #5)
> I guess mystery is solved. Accidently, I looked at dmesgs and saw this:
> 
> [264622.198764] Out of memory: Kill process 22770 (cc1) score 618 or
> sacrifice child
> [264622.198769] Killed process 22770 (cc1) total-vm:1299668kB,
> anon-rss:778212kB, file-rss:108kB
> 
> 1GB RAM is not enough to build newer versions of mesa.

That's crazy.  Can you add swap and see what happens.
Comment 7 Paul Osmialowski 2015-02-22 13:04:52 UTC
This machine has 1GB swap already, seems it was all consumed:

[264622.198096] cc1 invoked oom-killer: gfp_mask=0x200da, order=0, oom_score_adj=0
[264622.198110] cc1 cpuset=/ mems_allowed=0
[264622.198120] CPU: 0 PID: 22770 Comm: cc1 Not tainted 3.17.8-gentoo-r1 #1
[264622.198124] Call Trace:
[264622.198141] [cc133b60] [c00087cc] show_stack+0x48/0x15c (unreliable)
[264622.198148] [cc133ba0] [c0951b00] dump_stack+0x24/0x34
[264622.198161] [cc133bb0] [c094ee40] dump_header.isra.14+0x40/0x130
[264622.198168] [cc133be0] [c0092c70] oom_kill_process+0x298/0x3a0
[264622.198172] [cc133c30] [c0093224] out_of_memory+0x220/0x2c8
[264622.198179] [cc133c80] [c00967c0] __alloc_pages_nodemask+0x72c/0x73c
[264622.198192] [cc133d40] [c00be5d0] read_swap_cache_async+0x11c/0x184
[264622.198198] [cc133d80] [c00be78c] swapin_readahead+0x154/0x1c4
[264622.198209] [cc133de0] [c00b0c14] handle_mm_fault+0x5b4/0x7ac
[264622.198218] [cc133e40] [c0016b20] do_page_fault+0x380/0x644
[264622.198223] [cc133f40] [c0013188] handle_page_fault+0xc/0x80
[264622.198228] --- interrupt: 301 at 0x1026b6ec
    LR = 0x1026beb4
[264622.198233] Mem-Info:
[264622.198236] DMA per-cpu:
[264622.198240] CPU    0: hi:  186, btch:  31 usd: 180
[264622.198243] HighMem per-cpu:
[264622.198246] CPU    0: hi:   90, btch:  15 usd:  50
[264622.198256] active_anon:104494 inactive_anon:104599 isolated_anon:0
 active_file:91 inactive_file:143 isolated_file:0
 unevictable:36685 dirty:0 writeback:0 unstable:0
 free:1153 slab_reclaimable:3286 slab_unreclaimable:2260
 mapped:151 shmem:0 pagetables:935 bounce:0
 free_cma:0
[264622.198278] DMA free:4396kB min:3488kB low:4360kB high:5232kB active_anon:307228kB inactive_anon:307460kB active_file:364kB inactive_file:572kB unevictable:106964kB isolated(anon):0kB isolated(file):0kB present:786432kB managed:761772kB mlocked:0kB dirty:0kB writeback:0kB mapped:604kB shmem:0kB slab_reclaimable:13144kB slab_unreclaimable:9040kB kernel_stack:1616kB pagetables:3740kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:6416 all_unreclaimable? yes
[264622.198282] lowmem_reserve[]: 0 0 256 256
[264622.198296] HighMem free:216kB min:256kB low:556kB high:856kB active_anon:110748kB inactive_anon:110936kB active_file:0kB inactive_file:0kB unevictable:39776kB isolated(anon):0kB isolated(file):0kB present:262144kB managed:262144kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:1360 all_unreclaimable? yes
[264622.198299] lowmem_reserve[]: 0 0 0 0
[264622.198304] DMA: 169*4kB (UR) 3*8kB (R) 1*16kB (R) 5*32kB (R) 5*64kB (R) 3*128kB (R) 3*256kB (R) 2*512kB (R) 1*1024kB (R) 0*2048kB 0*4096kB = 4396kB
[264622.198324] HighMem: 0*4kB 1*8kB (R) 1*16kB (R) 0*32kB 1*64kB (R) 1*128kB (R) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 216kB
[264622.198340] 37211 total pagecache pages
[264622.198345] 292 pages in swap cache
[264622.198348] Swap cache stats: add 271837, delete 271545, find 16428/19339
[264622.198351] Free swap  = 0kB
[264622.198354] Total swap = 1048572kB
[264622.198357] 262144 pages RAM
[264622.198360] 65536 pages HighMem/MovableOnly
[264622.198362] 0 pages reserved

Since it is SSD drive, it has reduced swappiness in /etc/sysctl.conf:

# Swap on SSD, reduce writes
vm.swappiness=1
vm.vfs_cache_pressure=50
Comment 8 Scott Goedeke 2015-02-24 01:34:12 UTC
I put ">media-libs/mesa-10.2.8" in package.mask,
then re-ran emerge --update --deep @world again

This time media-libs/mesa-10.2.8 was re-merged and it, as well as the other 15 packages, successfully completed merging with no errors. Memory usage was modest (<200 MB) during re-merging of mesa-10.2.8.
Comment 9 Thomas Haschka 2015-02-27 11:09:00 UTC
same here on ppc. Mesa-10.3.7 failed to emerge with 1.5 Gig ram on the machine and 4gig swap running out of memory.
Comment 10 Thomas Haschka 2015-02-27 11:09:38 UTC
same here on ppc. Mesa-10.3.7 failed to emerge with 1.5 Gig ram on the machine and 4gig swap running out of memory.
Comment 11 Thomas Haschka 2015-02-27 17:28:53 UTC
Workaround!

It actually compilies nicely using CFLAGS="-O1" without exceeding 800 megs of ram. ( exact CFLAGS="-O1 -mcpu=7450 -pipe" )
Comment 12 Scott Goedeke 2015-02-28 01:05:18 UTC
I got it to compile also with -O1, but not as nicely. I have 750 MB of RAM and 1GB of SWAP.  It took 1.5 GB of it at its greediest. Including the reset of the system I had 30 MB to spare.  Whew that was close!  I used:
CFLAGS="-O1 -mcpu=7450 -mtune=7450 -mabi=altivec -maltivec -fno-strict-aliasing -pipe"
CXXFLAGS="${CFLAGS}"
Comment 13 Andrew Savchenko gentoo-dev 2015-02-28 01:14:12 UTC
Typical OOM issue. Looks like ebuild should use CHECKREQS_MEMORY. Probably binary package alternative may be provided for users with low memory systems.
Comment 14 Matt Turner gentoo-dev 2015-02-28 17:45:33 UTC
Created attachment 397682 [details, diff]
patch

format_utils.c consisted of a ridiculously large switch statement with multiple levels of nested switch statements. It took ~5 minutes to compile on 32-bit x86, presumably because it was exercising some quadratic time path in gcc. I'd bet that this is basically the same problem.

Please applying this patch to your Mesa build and confirm that it allows it to compile with significantly less memory.
Comment 15 Scott Goedeke 2015-03-01 19:06:16 UTC
(In reply to Matt Turner from comment #14)
> Created attachment 397682 [details, diff] [details, diff]
> patch
> 
> format_utils.c consisted of a ridiculously large switch statement with
> multiple levels of nested switch statements. It took ~5 minutes to compile
> on 32-bit x86, presumably because it was exercising some quadratic time path
> in gcc. I'd bet that this is basically the same problem.
> 
> Please applying this patch to your Mesa build and confirm that it allows it
> to compile with significantly less memory.

Created /etc/portage/patches/media-libs/mesa-10.3.7-r1 and put the patch there.

emerged mesa with:
CFLAGS="-O1 -mcpu=7450 -mtune=7450 -mabi=altivec -maltivec -fno-strict-aliasing -pipe"
CXXFLAGS="${CFLAGS}"

Completed with no errors and I did not observe memory usage above 200 MB.

Re-booted, started Firefox, Thunderbird - which depend on mesa and ran normally.

emerged mesa with:
CFLAGS="-O2 -mcpu=7450 -mtune=7450 -mabi=altivec -maltivec -fno-strict-aliasing -pipe"
CXXFLAGS="${CFLAGS}"

Completed with no errors and I did not observe memory usage above 250 MB.

For all cases I had MAKEOPTS="-j2" so I have been adding the memory usage of both cc1 processes.

Patch looks good!
Comment 16 Matt Turner gentoo-dev 2015-03-01 19:35:49 UTC
Thanks a lot for testing (and reporting). I've added the patch to 10.3.7-r{1,2}. 10.4.x and newer already have the patch.