Summary: | >=app-emulation/wine-0.9.21 - memory leak compiling vartest.c w/ -finline-functions (-O3/-Os) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Paul Taylor <birder> |
Component: | Current packages | Assignee: | Wine Maintainers <wine> |
Status: | RESOLVED UPSTREAM | ||
Severity: | major | CC: | bakirov, ca368604, cene, ed, elreydetodo, email.argin, gentoo-bugs, gentoo-bugzilla, gigi, gilles.gagniard, grafgrimm77, ixevix, james_wells, jan.simons, leio, mrc_timer, notellin, p-twohig, parmigio, polynomial-c, radek, saintdev, telefrancisco, turmlos, uzytkownik2, work |
Priority: | High | ||
Version: | 2006.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
remove -O3 from dlls/oleaut32/tests/Makefile
remove -O3 from dlls/oleaut32/tests/Makefile (2nd try) wine-compile-fix.diff app-emulation/wine-0.9.25 gcc 4.1.1* fixed ebuild |
Description
Paul Taylor
2006-09-13 23:44:27 UTC
define "all swap" allocating ~50megs for gcc is not a bug in and of itself you could try removing -pipe from your CFLAGS/CXXFLAGS Have the same problem, removing "-pipe" from C(XX)FLAGS does not help: cc1: out of memory allocating 157111760 bytes after a total of 113373184 bytes i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon-xp -O3 -o sock.o sock.c make[2]: *** [vartest.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/wine-0.9.21/work/wine-0.9.21/dlls/oleaut32/tests' make[1]: *** [oleaut32/tests] Error 2 ../../../tools/make_ctests -o testlist.c protocol.c sock.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon-xp -O3 -o testlist.o testlist.c ../../../tools/winegcc/winegcc -B../../../tools/winebuild -mconsole protocol.o sock.o testlist.o -o ws2_32_test.exe.so ../../../libs/port/libwine_port.a -lws2_32 -lkernel32 make[2]: Leaving directory `/var/tmp/portage/wine-0.9.21/work/wine-0.9.21/dlls/ws2_32/tests' make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/var/tmp/portage/wine-0.9.21/work/wine-0.9.21/dlls' make: *** [dlls] Error 2 !!! ERROR: app-emulation/wine-0.9.21 failed. Call stack: ebuild.sh, line 1546: Called dyn_compile ebuild.sh, line 937: Called src_compile wine-0.9.21.ebuild, line 113: Called die !!! all !!! If you need support, post the topmost build error, and the call stack if relevant. > define "all swap" 472MB RAM (512MB, less on-board video memory) + 2GB swap partition. > allocating ~50megs for gcc is not a bug in and of itself How about over 1.5GB? :-) (It didn't fully exhaust the swap, because the disk was thrashing madly with approx. 1GB of swap allocated.) Running an strace on the build shows it is repeatedly allocating chunks of memory: often 1MB at a time, but several of approx. 38MB prior to running out of RAM (MemFree: 426720 kB.) I've disabled swap for testing so that it will fail before the system is brought to its knees: [snip] 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x529d2000 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x52ad2000 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x52bd2000 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x52cd2000 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x52dd2000 19889 mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x409a4000 19889 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x52ed2000 19889 mmap2(NULL, 38178816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) 19889 brk(0x11613000) = 0xf1ab000 19889 mmap2(NULL, 38309888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) 19889 mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x578c4000 19889 munmap(0x578c4000, 245760) = 0 19889 munmap(0x57a00000, 802816) = 0 19889 mprotect(0x57900000, 135168, PROT_READ|PROT_WRITE) = 0 19889 mmap2(NULL, 38178816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) 19889 write(2, "\ncc1: out of memory allocating 3"..., 79) = 79 [snip] > you could try removing -pipe from your CFLAGS/CXXFLAGS No change. I've also reproduced the problem on an AMD64 box (1GB RAM): # emerge --info Portage 2.1.1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64) ================================================================= System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 Processor 3500+ Gentoo Base System version 1.12.4 Last Sync: Thu, 14 Sep 2006 06:50:01 +0000 app-admin/eselect-compiler: [Not Present] dev-lang/python: 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.16 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -mtune=athlon64 -O3 -pipe -msse -msse2 -mfpmath=sse -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=athlon64 -mtune=athlon64 -O3 -pipe -msse -msse2 -mfpmath=sse -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" LANG="en_AU" LC_ALL="en_AU" LINGUAS="" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.au.gentoo.org" USE="amd64 X a52 aac acpi alsa amr arts asf audiofile bash-completion berkdb bitmap-fonts bzip2 bzlib cairo cdparanoia cdr cdrom chroot cli crypt cups curl dbus dlloader dmi dpms dri dts dv dvb dvd dvdr dvdread eds elibc_glibc emboss encode exif expat extrafilters fam fame fbcon ffmpeg firefox flac foomaticdb fortran gdbm gif gimpprint glitz gpm gps gsl gstreamer gtk gtk2 hal id3 idn imagemagick imap imlib input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse input_devices_wacom ipv6 isdnlog jack java jpeg jpeg2k junit kde kernel_linux lcms ldap libg++ lirc lirc_devices_livedrive_midi lm_sensors lzo mad mikmod mjpeg mmap mng mp3 mpeg mpeg4 musepack musicbrainz ncurses network nls nptl nptlonly nsplugin nvidia ogg oggvorbis openal opengl pam pcre pda pdf pdflib perl pic png ppds pppd python qt3 qt4 quicktime readline reflection sdk sdl session slang sndfile speex spell spl sqlite ssl svg symlink tcpd test theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales v4l v4l2 vcd video_cards_nv video_cards_nvidia vim vorbis vorbis-psy wmf x264 xcomposite xine xml xml2 xorg xpm xprint xscreensaver xv xvid xvmc yv12 zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY same here, 1GB RAM, 800MB swap, fully used - one cc1 process took sometimes 1GB of RAM alone Portage 2.1.1 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-gentoo-r8 i686) ================================================================= System uname: 2.6.17-gentoo-r8 i686 AMD Athlon(tm) XP 2600+ Gentoo Base System version 1.12.4 Last Sync: Thu, 14 Sep 2006 07:50:01 +0000 ccache version 2.4 [disabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-lang/python: 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r5 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -Os -fforce-addr -fomit-frame-pointer -ftracer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-march=athlon-xp -Os -fforce-addr -fomit-frame-pointer -ftracer -pipe -fvisibility-inlines-hidden -fno-enforce-eh-specs" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--newuse" FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict" GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo http://gentoo.inode.at http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://gentoo.osuosl.org http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo" LANG="de_DE.utf8" LC_ALL="de_DE.utf8" LDFLAGS="-Wl,-O1 -Wl,--sort-common" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X aac acpi alsa arts asf automount berkdb bitmap-fonts bzip2 cairo cddb cdparanoia cdr cli cups dbus dlloader dri dvd dvdr dvdread eds elibc_glibc emboss encode ffmpeg firefox flac fontconfig foomaticdb fortran ftp gdbm gif glitz gmp gnokii gpm graphviz gs gtk gtk2 hal howl idn ieee1394 imagemagick imap imlib input_devices_joystick input_devices_keyboard input_devices_mouse isdnlog jbig joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kernel_linux lame lcms libg++ libwww linguas_de lzo mad matroska mbox mhash mikmod mmx mng mozilla mozsvg mp3 mpeg mplayer musepack ncurses nls normalize nptl nptlonly nsplugin nvidia ogg openexr opengl oss pam pcre perl pic png ppds pppd qt qt3 quicktime readline real reflection samba session slp sndfile spell spl sse ssl svg tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l vcd video_cards_nv video_cards_nvidia video_cards_v4l vorbis win32codecs wmf wxwindows xine xinerama xml xorg xv xvid zlib zvbi" Unset: CTARGET, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS Commenting out MAKEOPTS does not help either. [ebuild U ] app-emulation/wine-0.9.21 [0.9.20] USE="X alsa arts cups dbus gif hal jpeg lcms ncurses opengl oss xml -debug -esd -glut -jack -ldap -nas -scanner" 0 kB works fine for me what is PID 19889 ? Same problem here. 1GB RAM and 2G swap. emerge --info Portage 2.1.1 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64) ================================================================= System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.12.5 Last Sync: Thu, 14 Sep 2006 13:00:01 +0000 app-admin/eselect-compiler: [Not Present] dev-lang/python: 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: 0.4.2-r1 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.16 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays" DISTDIR="/mnt/hda8/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/" LC_ALL="de_DE@euro" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/mnt/hda8/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/mnt/hda8/var/tmp" PORTDIR="/mnt/hda8/portage" PORTDIR_OVERLAY="/usr/local/overlays/gentoo-de /usr/local/overlays/bmg-main /usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X a52 alsa aotuv arts berkdb bitmap-fonts bzip2 cdr cjk cli crypt cups dga directfb dlloader dri dts dvd dvdr dvdread effects elibc_glibc exif fbcon ffmpeg flac fortran gdbm gif gimpprint gpm gtk2 hal imagemagick inkjar input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kernel_linux libcaca libg++ libsamplerate linguas_de lm_sensors mad matroska mng mp3 mysql ncurses nls nomotif nptl nptlonly nvidia ogg oggvorbis opengl pam pcre pdf perl png ppds pppd python qt qt3 readline reflection rtc scanner session spl sqlite ssl svg symlink tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales v4l video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i810 video_cards_mga video_cards_neomagic video_cards_nv video_cards_nvidia video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo vorbis wmf xine xorg xv xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS I'd Success buildung wine 0.9.21 with 1 GB RAM / 2 GB Swap (at that point mentioned above gcc is using nearly 1 GB RAM and 1 GB Swap). This took some time. Than it continued building wine. Thu Sep 14 13:26:07 2006 >>> app-emulation/wine-0.9.21 merge time: 52 minutes and 29 seconds. (In reply to comment #7) > works fine for me NEEDINFO: "emerge --info" etc. for comparison? > what is PID 19889 ? The cc1 process: /usr/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1 -quiet -I. -I. -I../../../include -I../../../include -D_REENTRANT vartest.c -quiet -dumpbase vartest.c -march=pentium4 -mtune=pentium4 -auxbase-strip vartest.o -gstabs+ -O3 -Wall -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -fPIC -fno-strict-aliasing -o - Okay, the killer is -O3. Running the gcc command with everything except it completes in a timely (and memory efficient) manner, as does using "-O2". (In reply to comment #11) > Okay, the killer is -O3. Running the gcc command with everything except it > completes in a timely (and memory efficient) manner, as does using "-O2". > -Os too. (In reply to comment #12) > (In reply to comment #11) > > Okay, the killer is -O3. Running the gcc command with everything except it > > completes in a timely (and memory efficient) manner, as does using "-O2". > > > > -Os too. Yes; just noticed your CFLAGS were different and was trying it myself. :-) According to the gcc man page: -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions, -funswitch-loops and -fgcse-after-reload options. "-finline-functions" is to blame - presumably getting into a inlining loop. "-O2 -funswitch-loops -fgcse-after-reload" works. -Os Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size. -Os disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays -ftree-vect-loop-version This has me stumped, since it claims to be -O2 _less_ certain flags, though the "further optimizations designed to reduce code size" may include "-finline-functions", I guess. -Os does use -finline-functions; from the gcc 4.1.1 source: [snip] if (optimize_size) { /* Inlining of very small functions usually reduces total size. */ set_param_value ("max-inline-insns-single", 5); set_param_value ("max-inline-insns-auto", 5); flag_inline_functions = 1; [snip] So, the workaround appears to be append "-fno-inline-functions" to CFLAGS. (Forcing -O2 would also work, but is less desirable in Ren -Os does use -finline-functions; from the gcc 4.1.1 source: [snip] if (optimize_size) { /* Inlining of very small functions usually reduces total size. */ set_param_value ("max-inline-insns-single", 5); set_param_value ("max-inline-insns-auto", 5); flag_inline_functions = 1; [snip] So, the workaround appears to be append "-fno-inline-functions" to CFLAGS. (Forcing -O2 would also work, but is less desirable in René's case where he is optimising for size.) This GCC bug appears to fit the problem: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27881 Same problem here, also noticed (but not tested recently) there were problems with other ebuilds like xmame for example. Repro'd the issue on P4M (Centrino) w/512MB RAM / 1GB SWAP. Compiling vartest.c caused GCC to allocate nearly all available RAM / SWAP. iowait state on the system went through the roof and the system was panic swapping 1MB chunks as fast as it could. CFLAGS set to use -O3 and -pipe. I am using GCC-4.1.1-r1 and I was using ccache the first time I tried to compile it, disabled ccache for attempt 2 and 3, no change Just added -fno-inline-functions and will attempt to recompile, leaving all other flags alone. Okay, dropping down to -O2 and -fno-inline-functions allowed it to complete compilation. (In reply to comment #18) > Okay, dropping down to -O2 and -fno-inline-functions allowed it to complete > compilation. "-O2" doesn't need "-fno-inline-functions"; "-O2" alone is sufficient, since it doesn't include "-finline-functions". "-O3" and "-Os" do include "-finline-functions", so you need to add "-fno-inline-functions" to cancel it to avoid the gcc bug. *** Bug 147733 has been marked as a duplicate of this bug. *** it will succeed eventually the issue is that vartest.c expands to ~3megs of source code with a bunch of little functions, so inlining takes quite a bit of time and memory so the question: is this really a memory leak or is it normal considering the optimizations requested and the size of the source code Portage 2.1.2_pre1 (default-linux/amd64/2006.0, gcc-4.1.1/amd64-vanilla, glibc-2.4.90.20060805-r1, 2.6.17-emission8 x86_64) ================================================================= System uname: 2.6.17-emission8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ Gentoo Base System version 1.12.5 Last Sync: Mon, 18 Sep 2006 10:00:03 +0000 ccache version 2.4 [disabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-java/java-config: 1.3.6-r1, 2.0.28-r1 dev-lang/python: 2.3.5-r2, 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 dev-util/confcache: 0.4.2 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17, 2.17.50.0.3 sys-devel/gcc-config: 2.0.0_rc1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.16 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -msse3 -mmmx -msse -Os -pipe -fno-ident -finline-functions -finline-functions-called-once -floop-optimize2 -ftracer -fweb -fforce-addr -funroll-loops -fomit-frame-pointer -frename-registers -ftree-vectorize" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-march=athlon64 -msse3 -mmmx -msse -Os -pipe -fno-ident -finline-functions -finline-functions-called-once -floop-optimize2 -ftracer -fweb -fforce-addr -funroll-loops -fomit-frame-pointer -frename-registers -ftree-vectorize -fno-enforce-eh-specs" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/ http://85.25.128.62 ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://ftp.roedu.net/pub/mirrors/gentoo.org/ ftp://130.59.10.34/mirror/gentoo/ http://ftp.roedu.net/pub/mirrors/gentoo.org/ ftp://ftp.nyx.hu/gentoo http://mirror.uni-c.dk/pub/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://213.186.33.37/gentoo-distfiles/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://212.219.56.152/sites/www.ibiblio.org/gentoo/ http://212.219.56.146/sites/www.ibiblio.org/gentoo/ ftp://ftp.citkit.ru/pub/Linux/gentoo ftp://ftp.heanet.ie/pub/gentoo/ http://212.219.56.152/sites/www.ibiblio.org/gentoo/" LANG="cs_CZ.utf8" LC_ALL="cs_CZ.utf8" LINGUAS="cs en_US" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X a52 aac aalib alsa apache2 authdaemond avi berkdb bitmap-fonts bitmaps-font bzip2 cairo cdr cli crypt cups directfb dlloader dmi dri dts dvd dvdr eds elibc_glibc emboss emul-linux-x86 encode evdev ffmpeg flac foomaticdb gdb gif glibc-omitfp gpm gstreamer gtk gtk2 hal hashstyle ieee1394 imagemagick imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog javascript jpeg kde kernel_linux ldap linguas_cs linguas_en_US lzw lzw-tiff mono mp3 mpeg mysql ncurses nls nptl nptlonly nsplugin ogg oggvorbis opengl oss pam pcre pdf pdflib perl php png pppd python qt qt3 qt4 quicktime rar readline reflection rpm samba sasl sdl session slang spell spl sse3 ssl stream tcpd tiff truetype truetype-fonts type1-fonts unicode usb userland_GNU userlocales video_cards_tdfx video_cards_vesa video_cards_voodoo vorbis wmf xml xml2 xmms xorg xpm xv xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS Hello, i have the same problem .. rm -f wineesd.drv.so && ln -s winmm/wineesd/wineesd.drv.so wineesd.drv.so rm -f winejack.drv.so && ln -s winmm/winejack/winejack.drv.so winejack.drv.so rm -f winenas.drv.so && ln -s winmm/winenas/winenas.drv.so winenas.drv.so rm -f wineoss.drv.so && ln -s winmm/wineoss/wineoss.drv.so wineoss.drv.so i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o monitor.o monitor.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o msg.o msg.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o resource.o resource.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o sysparams.o sysparams.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o text.o text.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o win.o win.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o winstation.o winstation.c i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o wsprintf.o wsprintf.c ../../../tools/make_ctests -o testlist.c class.c clipboard.c cursoricon.c dce.c dde.c dialog.c edit.c generated.c input.c listbox.c menu.c monitor.c msg.c resource.c sysparams.c text.c win.c winstation.c wsprintf.c ../../../tools/bin2res -f -o test_mono.bmp ./resource.rc i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -march=athlon64 -Os -pipe -fno-ident -o testlist.o testlist.c LD_LIBRARY_PATH="../../../libs/wine:$LD_LIBRARY_PATH" ../../../tools/wrc/wrc --nostdinc -I. -I. -I../../../include -I../../../include -foresource.res resource.rc ../../../tools/winegcc/winegcc -B../../../tools/winebuild -mconsole class.o clipboard.o cursoricon.o dce.o dde.o dialog.o edit.o generated.o input.o listbox.o menu.o monitor.o msg.o resource.o sysparams.o text.o win.o winstation.o wsprintf.o testlist.o resource.res -o user32_test.exe.so ../../../libs/port/libwine_port.a -luser32 -lgdi32 -ladvapi32 -lkernel32 make[2]: Leaving directory `/var/tmp/portage/wine-0.9.21/work/wine-0.9.21/dlls/user/tests' Here compilation runs out of memory.. (In reply to comment #21) > it will succeed eventually > > the issue is that vartest.c expands to ~3megs of source code with a bunch of > little functions, so inlining takes quite a bit of time and memory > > so the question: is this really a memory leak or is it normal considering the > optimizations requested and the size of the source code > Either way, wouldn't it be wise to add a warning to the ebuild if you're using -O3 saying it will eat up all of your memory? s/all/a lot/ (In reply to comment #21) > so the question: is this really a memory leak or is it normal considering the > optimizations requested and the size of the source code I've been doing some more experimenting, and found that GCC 4.0.3 and 4.2.0-alpha20060902 (both masked) showed similar memory usage; these are supposed to be unaffected by the GCC bug I referred to in Comment #15. gcc-4.1.1-r1 seems a little better behaved that gcc-4.1.1 (used in the original bug report), but it's hard to say. Even so, 3MB of source needing 1GB of memory for compilation seems rather ridiculous. I have around 900 Gentoo packages installed, and haven't seen anything like it before. similar problem here: i686-pc-linux-gnu-gcc -c -I. -I. -I../../../include -I../../../include -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -O3 -march=athlon-xp -pipe -o testlist.o testlist.c LD_LIBRARY_PATH="../../../libs/wine:$LD_LIBRARY_PATH" ../../../tools/wrc/wrc --nostdinc -I. -I. -I../../../include -I../../../include -foresource.res resource.rc rm -f winearts.drv.so && ln -s winmm/winearts/winearts.drv.so winearts.drv.so rm -f wineaudioio.drv.so && ln -s winmm/wineaudioio/wineaudioio.drv.so wineaudioio.drv.so rm -f winecoreaudio.drv.so && ln -s winmm/winecoreaudio/winecoreaudio.drv.so winecoreaudio.drv.so rm -f wineesd.drv.so && ln -s winmm/wineesd/wineesd.drv.so wineesd.drv.so rm -f winejack.drv.so && ln -s winmm/winejack/winejack.drv.so winejack.drv.so rm -f winenas.drv.so && ln -s winmm/winenas/winenas.drv.so winenas.drv.so rm -f wineoss.drv.so && ln -s winmm/wineoss/wineoss.drv.so wineoss.drv.so ../../../tools/winegcc/winegcc -B../../../tools/winebuild -mconsole class.o clipboard.o cursoricon.o dce.o dde.o dialog.o edit.o generated.o input.o listbox.o menu.o monitor.o msg.o resource.o sysparams.o text.o win.o winstation.o wsprintf.o testlist.o resource.res -o user32_test.exe.so ../../../libs/port/libwine_port.a -luser32 -lgdi32 -ladvapi32 -lkernel32 make[2]: Leaving directory `/var/tmp/portage/wine-0.9.21/work/wine-0.9.21/dlls/user/tests' cc1: out of memory allocating 157111760 bytes after a total of 113541120 bytes have a look at the last line: "out of memory". # emerge --info Portage 2.1.2_pre1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.17.13 i686) ================================================================= System uname: 2.6.17.13 i686 AMD Athlon(tm) XP 2100+ Gentoo Base System version 1.12.5 Last Sync: Mon, 18 Sep 2006 16:00:01 +0000 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.4 [disabled] app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.6-r1, 2.0.28-r1 dev-lang/python: 2.3.5-r2, 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe" DISTDIR="/mnt/data/archiv/gentoo/distfiles" FEATURES="autoconfig distcc distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://duron/portage/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo/" LANG="de_DE.utf8" LC_ALL="" LINGUAS="de" MAKEOPTS="-j4" PKGDIR="/mnt/data/archiv/gentoo/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://duron/gentoo-portage" USE="x86 3dnow X acl acpi aim alsa apache2 apm arts berkdb bitmap-fonts bzip2 cairo cdr cjk cli crypt cups dlloader dri dvb dvd dvdr elibc_glibc emboss encode esd exif fam ffmpeg firefox flac foomaticdb fortran gdbm gif gnome gnutls gphoto2 gpm gstreamer gtk gtk2 guile hal icq imlib input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse ipv6 isdnlog jabber java jpeg jpeg2k kde kernel_linux ldap libg++ libwww linguas_de mad matroska mikmod mmx mng motif mp3 mpeg ncurses nls nptl nptlonly offensive ogg openal opengl oss pam pcre perl png pppd python qt qt3 qt4 quicktime readline reflection sdl session speex spell spl sse ssl svg tcpd tiff truetype truetype-fonts type1-fonts udev unicode userland_GNU v4l vhosts video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_v4l video_cards_vesa video_cards_vga vorbis win32codecs wmf xine xinerama xml xorg xprint xv yahoo zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS I've added extra-swap 1Gb, (before had only 512Mb) , and all compiled cleanly cd /somwhere/where/you/have/lot_of_Free_Space dd if=/dev/zero of=extra-swap bs=1024 count=1048576 swapon extra-swap after compilation you can do: swapoff extra-swap and rm extra-swap forget to add som extra-info localhost demon # emerge --info Portage 2.1.2_pre1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.17-ck1-r3 i686) ================================================================= System uname: 2.6.17-ck1-r3 i686 AMD Athlon(tm) XP 2800+ Gentoo Base System version 1.12.5 Last Sync: Wed, 20 Sep 2006 16:50:01 +0000 app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.6-r1, 2.0.29 dev-lang/python: 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -mtune=athlon-xp -march=athlon-xp -pipe -funroll-loops -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-Os -mtune=athlon-xp -march=athlon-xp -pipe -funroll-loops -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles/" LANG="ru_RU.KOI8-R" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_EXTRA_OPTS=" --exclude='/tmp'" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/usr/portage/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY=" " SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X aac alsa apache2 apm asf berkdb bitmap-fonts browserplugin bzip2 cairo chardet cli crypt cups dbus dga divx4linux dlloader dri dvd dvdr dvdread eds elibc_glibc emboss encode ffmpeg flac foomaticdb fortran gif gimpprint glitz gphoto2 gtk2 hal imagemagick imlib input_devices_keyboard input_devices_mouse isdnlog java javascript joystick jpeg jpeg2k kde kernel_linux kqemu libg++ libwww lirc_devices_pixelview_pro lm_sensors logitech-mouse lzo mad mikmod mmx mmxext modplug mp3 mpeg mplayer ncurses nptl nptlonly nsplugin nvidia ogg opengl oss pam pcre perl pic png pppd python qt3 quotas readline real reflection rtc samba sdl session spell spl sse ssl svg tcpd tiff timidity truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l v4l2 video_cards_nv video_cards_nvidia video_cards_v4l vim-with-x vorbis win32codecs wma wxwindows xcomposite xml xmms xorg xv xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, LINGUAS localhost demon # emerge -pv wine These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] app-emulation/wine-0.9.21 USE="X alsa cups dbus gif hal jpeg ncurses opengl oss xml -arts -debug -esd -glut -jack -lcms -ldap -nas -scanner" 0 kB same thing here, 256MB mem, 512MB swap Portage 2.1.2_pre1 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.16-gentoo-r7 i686) ================================================================= System uname: 2.6.16-gentoo-r7 i686 Intel(R) Pentium(R) III Mobile CPU 1000MHz Gentoo Base System version 1.12.5 Last Sync: Thu, 21 Sep 2006 21:30:01 +0000 ccache version 2.4 [enabled] app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.6-r1, 2.0.29 dev-lang/python: 2.3.5-r2, 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -march=pentium3 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-Os -march=pentium3 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo http://mirrors.acm.cs.rpi.edu/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/" LC_ALL="en_US.utf8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/initng-portage" SYNC="rsync://192.168.2.11/gentoo-portage" USE="x86 X acpi alsa bitmap-fonts bzip2 cairo cdr cli crypt cups divx4linux dlloader dri dvd dvdr elibc_glibc emboss encode fam firefox flac fortran gdbm gif gimp glut gmp gpm gstreamer gtk idn imagemagick input_devices_keyboard input_devices_mouse input_devices_synaptics isdnlog java jpeg kde kdeenablefinal kernel_linux lcms libg++ mmap mmx mng mp3 mpeg ncurses network nptl nptlonly nsplugin ogg opengl pam pcmcia pcre perl png ppds pppd python qt3 qt4 quicktime readline real reflection session spl sse ssl svg tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_radeon vim-with-x vorbis win32codecs xml xml2 xorg xv xvid xvmc zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS adding -fno-inline-functions to CFLAGS does not fix the problem on my system (In reply to comment #30) > adding -fno-inline-functions to CFLAGS does not fix the problem on my system > same here... Created attachment 98369 [details, diff]
remove -O3 from dlls/oleaut32/tests/Makefile
wine-0.9.22 is affetcted by the same problem, i'm attaching a little patch that worked for me: basically i drop -O3 and use -O1 in dlls/oleaut32/tests/Makefile.
This is a patch against the ebuild not to the Makefile so i can test when to apply and should work with many wine versions.
CFLAGS="-march=pentium4 -O2 -pipe" emerge wine fixes the problem for me, please filter! (In reply to comment #32) > wine-0.9.22 is affetcted by the same problem, i'm attaching a little patch that > worked for me: This patch works for me as well, please include in portage. (In reply to comment #34) > (In reply to comment #32) > > wine-0.9.22 is affetcted by the same problem, i'm attaching a little patch that > > worked for me: > > This patch works for me as well, please include in portage. > It worked for me also, but after deleting the first line, because it won't work for internationalized gcc's. Anyway, that patch is not a fix, just a workaround. I don't know if QA will accept that. In reply to comment #35) > (In reply to comment #34) > > (In reply to comment #32) > > > wine-0.9.22 is affetcted by the same problem, i'm attaching a little patch that > > > worked for me: > > > > This patch works for me as well, please include in portage. > > > > It worked for me also, but after deleting the first line, because it won't work > for internationalized gcc's. Anyway, that patch is not a fix, just a > workaround. I don't know if QA will accept that. > it is possible to change the first line to recognize another gcc affetcted by the problem, i hope the QA can accept it since it only gets applied for some gcc version so if ever a release of gcc not affected by the bug will be released the patch will automatically not applied. (In reply to comment #36) > > it is possible to change the first line to recognize another gcc affetcted by > the problem, i hope the QA can accept it since it only gets applied for some > gcc version so if ever a release of gcc not affected by the bug will be > released the patch will automatically not applied. > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: gcc-4.1.1 (the version I'm using) Internationalized versions of gcc. In my case (spanish) the output of gcc -v (just the "important" line) is: gcc versi (In reply to comment #36) > > it is possible to change the first line to recognize another gcc affetcted by > the problem, i hope the QA can accept it since it only gets applied for some > gcc version so if ever a release of gcc not affected by the bug will be > released the patch will automatically not applied. > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: gcc-4.1.1 (the version I'm using) Internationalized versions of gcc. In my case (spanish) the output of gcc -v (just the "important" line) is: gcc versión 4.1.1 (Gentoo 4.1.1) so the sed it's not valid (not just because the 4.1.1 instead of 4.1.1-r1, but also for the "versión" string, instead of "version"). The patch is good (I use it) but it's simply not the solution, and Wine 0.9.23 is going to be released soon and the problem is still there. Won't be more useful talking to upstream (both wine and gcc) to check where the problem is? As described earlier, "-Os" is also affected which the patch doesn't cater for. Instead of changing -O, just append "-fno-inline-functions" to the CFLAGS as given - that removes the actual problem regardless of whatever CFLAGS are given. (In reply to comment #37) > Won't be more useful talking to upstream (both wine and gcc) to check where the problem is? I filed a bug report upstream; it was rejected as "invalid" ("not a Wine bug", "we don't support -O3" etc.) (In reply to comment #38) > just append "-fno-inline-functions" to the CFLAGS as > given - that removes the actual problem regardless of whatever CFLAGS are > given. > Comments #30 and #31 said that didn't work for them. (In reply to comment #39) > I filed a bug report upstream; it was rejected as "invalid" ("not a Wine bug", > "we don't support -O3" etc.) > Can you please post the URL of the bug? Thanks in advance. (In reply to comment #34) > (In reply to comment #32) > > wine-0.9.22 is affetcted by the same problem, i'm attaching a little patch that > > worked for me: > > This patch works for me as well, please include in portage. Same patch works with wine-0.9.23 (In reply to comment #40) > (In reply to comment #39) > > I filed a bug report upstream; it was rejected as "invalid" ("not a Wine bug", > > "we don't support -O3" etc.) > > Can you please post the URL of the bug? Thanks in advance. I think its this one: http://bugs.winehq.org/show_bug.cgi?id=6203 (In reply to comment #40) > > just append "-fno-inline-functions" to the CFLAGS as > > given - that removes the actual problem regardless of whatever CFLAGS are > > given. > > Comments #30 and #31 said that didn't work for them. You can't add "-fno-inline-functions" to the CFLAGS in /etc/make.conf - the "strip-flags" directive in the ebuild will remove it. Created attachment 99792 [details, diff] remove -O3 from dlls/oleaut32/tests/Makefile (2nd try) (In reply to comment #37) > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: > gcc-4.1.1 (the version I'm using) > Internationalized versions of gcc. In my case (spanish) the output of gcc -v > (just the "important" line) is: > gcc versi Created attachment 99792 [details, diff] remove -O3 from dlls/oleaut32/tests/Makefile (2nd try) (In reply to comment #37) > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: > gcc-4.1.1 (the version I'm using) > Internationalized versions of gcc. In my case (spanish) the output of gcc -v > (just the "important" line) is: > gcc versión 4.1.1 (Gentoo 4.1.1) > > so the sed it's not valid (not just because the 4.1.1 instead of 4.1.1-r1, but > also for the "versión" string, instead of "version"). > > The patch is good (I use it) but it's simply not the solution, and Wine 0.9.23 > is going to be released soon and the problem is still there. Won't be more > useful talking to upstream (both wine and gcc) to check where the problem is? > this one should be more relaxed about version checking, i simply get the branded version of the compiler and test it against a list of know problematic gcc versions. I also modified the sed part from -O3 to -O. in order to match everything after the -O (-Os for example). IWFM(tm) *** Bug 153118 has been marked as a duplicate of this bug. *** (In reply to comment #44) > Created an attachment (id=99792) [edit] > remove -O3 from dlls/oleaut32/tests/Makefile (2nd try) > > (In reply to comment #37) > > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: > > gcc-4.1.1 (the version I'm using) > > Internationalized versions of gcc. In my case (spanish) the output of gcc -v > > (just the "important" line) is: > > gcc versi (In reply to comment #44) > Created an attachment (id=99792) [edit] > remove -O3 from dlls/oleaut32/tests/Makefile (2nd try) > > (In reply to comment #37) > > I repeat, this patch only applies to gcc-4.1.1-r1, but it should apply also to: > > gcc-4.1.1 (the version I'm using) > > Internationalized versions of gcc. In my case (spanish) the output of gcc -v > > (just the "important" line) is: > > gcc versión 4.1.1 (Gentoo 4.1.1) > > > > so the sed it's not valid (not just because the 4.1.1 instead of 4.1.1-r1, but > > also for the "versión" string, instead of "version"). > > > > The patch is good (I use it) but it's simply not the solution, and Wine 0.9.23 > > is going to be released soon and the problem is still there. Won't be more > > useful talking to upstream (both wine and gcc) to check where the problem is? > > > > this one should be more relaxed about version checking, i simply get the > branded version of the compiler and test it against a list of know problematic > gcc versions. > I also modified the sed part from -O3 to -O. in order to match everything after > the -O (-Os for example). > IWFM(tm) > umm ... since this bug should effect most versions of GCC, why not just add: replace-flags -Os -O2 replace-flags -O3 -O2 right under or above the line that reads "strip-flags"? That is a whole lot more cleaner and reduces the compiler level to a safe one. Also, if you wanted to be safe you could add just one line: replace-flags -O? -O1 which puts them all to -O1. I like -O2 though. :P Cheers. Created attachment 100726 [details, diff]
wine-compile-fix.diff
On second thought, I really like compiling wine with my flag of -Os, so I modified the patch already submitted. I cleaned it up and made it a lot simpler. Since GCC 4.1.1 is stable now, and issues have been known with other versions, I completely took out the version check. Then I made the sed line a lot smaller. Please test this and see if it works for you.
What it does:
It will look for all -Os and -O3 flags and turn them into -O2, since -O2 works. This way you can get a little more out of it. ;)
If anyone knows how to make the sed line even more simple, please let me know. I am curious to find out myself. The sed line in the patch file:
+ sed -ri "s/-Os|-O3/-O2/g" dlls/oleaut32/tests/Makefile \
+ || die "Compile fix failed"
Cheers.
my sed command is a little more complicated since i wanted to change -O? to -O1 only for CFLAGS lines ;) btw wine-0.9.24 is still suffering from this bug. (In reply to comment #47) > Created an attachment (id=100726) [edit] > wine-compile-fix.diff > > On second thought, I really like compiling wine with my flag of -Os, so I > modified the patch already submitted. I cleaned it up and made it a lot > simpler. Since GCC 4.1.1 is stable now, and issues have been known with other > versions, I completely took out the version check. Then I made the sed line a > lot smaller. Please test this and see if it works for you. > > What it does: > It will look for all -Os and -O3 flags and turn them into -O2, since -O2 works. > This way you can get a little more out of it. ;) > > If anyone knows how to make the sed line even more simple, please let me know. > I am curious to find out myself. The sed line in the patch file: > + sed -ri "s/-Os|-O3/-O2/g" dlls/oleaut32/tests/Makefile \ > + || die "Compile fix failed" > > Cheers. > *** Bug 153460 has been marked as a duplicate of this bug. *** (In reply to comment #48) > my sed command is a little more complicated since i wanted to change -O? to -O1 > only for CFLAGS lines ;) > btw wine-0.9.24 is still suffering from this bug. Yeah, but I wanted to compile it as -O2. I guess I am a bit of a ricer. The modified sed line that I have will take only -Os and -O3 and change it to -O2 and it will only change it for the tests makefile like yours does. I looked in that makefile and there was only one line with -O? stuff. So, yours is good for those want to go to -O1, and mine is good if they want to go to -O2, which gave me no trouble at all at compiling that troublesome part. I have no clue what that part does or why it blows up GCC, but all I know is that -O2 worked for me. :) Cheers. Wow, two months and still no real progress on this. <rant> Is it that hard to commit any of the patches submitted here? At least 3 dupes, already and all versions from 0.9.21 to 0.9.24 affected, a bunch of people subscribed to this bug. Could someone from "Wine Maintainers" please at least comment on the problem and why it takes so long to fix this bug? </rant> (In reply to comment #51) > Wow, two months and still no real progress on this. > <rant> > Is it that hard to commit any of the patches submitted here? > At least 3 dupes, already and all versions from 0.9.21 to 0.9.24 affected, a > bunch of people subscribed to this bug. > Could someone from "Wine Maintainers" please at least comment on the problem > and why it takes so long to fix this bug? > </rant> > And version 0.9.25 now. *cough* Created attachment 102382 [details, diff]
app-emulation/wine-0.9.25 gcc 4.1.1* fixed ebuild
Any news or direction on what to do or wait to fix it?
There are many solutions posted here, both working.
I'm attaching the ebuild checking the gcc versions and applying the fix.
(In reply to comment #53) > Created an attachment (id=102382) [edit] > app-emulation/wine-0.9.25 gcc 4.1.1* fixed ebuild > > Any news or direction on what to do or wait to fix it? > There are many solutions posted here, both working. > I'm attaching the ebuild checking the gcc versions and applying the fix. > GCC 4.1.1 is stable now and this bug affects all GCC 4.x from what I heard, so a tip, you can leave out the case statement and just apply the fix. See my patch, which is the same as the other one, but will convert the flag to -O2 instead of all flags to -O1. This is just a tip to make the ebuild a bit smaller. ;) Plus you can compile with -O2 instead of -O1.:P Cheers. About 2 months and a half later app-emulation/wine-0.9.27 is out and no clear advancement on this issue... :( (for Jon: i know your patch is fine, what i don't understand is why nothing is on portage..) *** Bug 159098 has been marked as a duplicate of this bug. *** In my case it was with -Os (In reply to comment #57) > In my case it was with -Os > Sorry I haven't seen it was mention (please add to subject). *bump* wine-0.9.28 is showing the same error. I can confirm Jon's patch works with the wine-0.9.28 ebuild. I created an overlay, copied the ebuild and files/ directory to the overlay and applied the patch there. Works fine. Thank you Jon. Point of interest, on this PC, I'm running a Duron 800, 0.5 gig ram, 1.0 gig swap. It's simply too slow for me to observe either the disk swap filling up or running out of ram. I could see it was doing something ... But I don't have the patience to let it run longer than overnight. Yet this is a PC I _want_ to optimize at -O3 when possible. Perhaps QA would accept forcing Wine to always compile at -O1 when specified in the user's CFLAGS and at -O2 for all other cases. I realize it's nice to be able to have most of a large package at -O3 and just a small portion at -O2, but a package level granular approach would be fine if it results in fewer reported problems. Of course, I don't know anything. I'm just a grateful user. :-D I got tired of patching the ebuild everytime, so I just set up a per package compile option to compile wine as -02. It works. Yeah, my patch made it possible for me to compile most of wine with -0s and that small part that fails as -02, but I just got tired of the hassle. Yeah. I agree that something should be done with the ebuild. I would accept if it stripped the -0s or -03 flag and replaced it with -02, just to end this stalemate. Granted, I like my patch, so I hope it's used, but just anything to to end this would be nice. As far as the devs not doing anything though, I think this may be a case of, "I told you so." The devs only support -02 compiler flag, and it works with -02, thus their supported method works. They have always advised users to use -02, because issues may arise with higher optimizations. They usually say that one needs to add a per package compile options if our higher than supported optimizations cause trouble. Cheers. *** Bug 162887 has been marked as a duplicate of this bug. *** There was one patch commited last week: http://source.winehq.org/git/wine.git/?a=commitdiff;h=25571d878960cd802aa31f291d473888dc01e035 *** Bug 183859 has been marked as a duplicate of this bug. *** |