Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256887 - dev-util/kbuild-0.1.4: ebuild spawns cvs process eating up all memory, stdout is flooded with *** %n in writable segment detected ***
Summary: dev-util/kbuild-0.1.4: ebuild spawns cvs process eating up all memory, stdout...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Markus Ullmann (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-30 07:04 UTC by Martin Walch
Modified: 2009-12-12 18:21 UTC (History)
5 users (show)

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


Attachments
/var/tmp/portage/dev-util/kbuild-0.1.4/temp/environment (environment,101.84 KB, text/plain)
2009-01-30 07:06 UTC, Martin Walch
Details
/var/tmp/portage/dev-util/kbuild-0.1.4/work/kBuild-0.1.4/out/linux.amd64/release/bootstrap/kmk/config.log (config.log,75.56 KB, text/plain)
2009-01-30 07:07 UTC, Martin Walch
Details
/var/tmp/portage/dev-util/kbuild-0.1.4/temp/build.log (build.log,142.79 KB, text/plain)
2009-01-30 07:08 UTC, Martin Walch
Details
output on stdout from emerging cvs with gcc 4.3.2-r3 (emerge_cvs_gcc_4.3.2-r3,76.67 KB, text/plain)
2009-01-31 16:57 UTC, Martin Walch
Details
output on stdout from emerging cvs with gcc 4.3.3 (emerge_cvs_gcc_4.3.3,78.18 KB, text/plain)
2009-01-31 16:58 UTC, Martin Walch
Details
diff -u emerge_cvs_gcc_4.3.2-r3 emerge_cvs_gcc_4.3.3 (diff_-u_gcc_4.3.2-r3_gcc_4.3.3,8.37 KB, text/plain)
2009-01-31 17:04 UTC, Martin Walch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Walch 2009-01-30 07:04:39 UTC
When emerging dev-util/kbuild-0.1.4, my box is starting to swap massively and is hardly responsive. ps and top show that cvs is running as a child process and is eating up all memory. After a while stdout is being flooded with

*** %n in writable segment detected ***

(I piped it into a file, but stopped after 100 MB of garbage)

installed cvs version is dev-util/cvs-1.12.12-r4

emerge --info

Portage 2.2_rc23 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.7-r2, 2.6.27-gentoo-r8 x86_64)
=================================================================                                      
System uname: Linux-2.6.27-gentoo-r8-x86_64-Intel-R-_Core-TM-2_CPU_4300_@_1.80GHz-with-glibc2.2.5      
Timestamp of tree: Thu, 29 Jan 2009 11:45:01 +0000                                                     
ccache version 2.4 [enabled]                                                                           
app-shells/bash:     3.2_p39                                                                           
dev-java/java-config: 1.3.7-r1, 2.1.6-r1                                                               
dev-lang/python:     2.5.2-r7                                                                          
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.1-r1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fgcse-after-reload -pipe"
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/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -fgcse-after-reload -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/java-overlay /usr/portage/local/layman/gnash-cvs /usr/portage/local/layman/mysql-testing /usr/portage/local/layman/enlightenment /usr/portage/local/layman/enlightenment /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib accessibility acl acpi agg akode alsa amarok amd64 apache2 bash-completion berkdb blender-game bluetooth branding bzip2 cairo captury cdaudio cdr cdrom cjk cli clucene cracklib crypt cups curl cviewer daap dbus designer-plugin dga dirac djvu dri dvd dvdnav dvdr dvdread dxr3 eds emacs embedded emboss encode evo fam fbcon ffmpeg fftw firefox fits flac fortran gcj gdbm ggi gif glibc-omitfp glitz gopher gpg gpm gstreamer hal hdri htmlhandbook iceweasel iconv icu imagemagick insecure-savers ipv6 isdnlog jabber jack java java5 java6 javascript jingle jpeg kde kde4 kdebuild kdecards kdeenablefinal kdehiddenvisibility kdepim kdm kontact ktts latex lcms ldap libcaca libnotify libwww lm_sensors logitech-mouse lua mad matroska mdnsresponder-compat midi mikmod mmx mng mp3 mpeg mpeg2 mpi mudflap mule multilib musepack mysql ncurses nepomuk nls noamazon nova nptl nptlonly nsplugin offensive ogg ogg123 openal openexr opengl openmp oss pam pcre pdf perl plasma png posix povray ppds pppd python qt3support qt4 quicktime readline reflection reiser4 reiserfs schroedinger sdl sdl-image semantic-desktop sensord session sndfile solver songs sound speex spell spl sse sse2 ssl startup-notification svg sysfs tcpd tetex theora threads tidytiff tools truetype type1 unicode usb vhook visualization vorbis wav wavpack xcomposite xemacs xine xml xorg xosd xprint xscreensaver xulrunner xv zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="i810 intel nv nvidia vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Martin Walch 2009-01-30 07:06:04 UTC
Created attachment 180222 [details]
/var/tmp/portage/dev-util/kbuild-0.1.4/temp/environment
Comment 2 Martin Walch 2009-01-30 07:07:11 UTC
Created attachment 180224 [details]
/var/tmp/portage/dev-util/kbuild-0.1.4/work/kBuild-0.1.4/out/linux.amd64/release/bootstrap/kmk/config.log
Comment 3 Martin Walch 2009-01-30 07:08:56 UTC
Created attachment 180225 [details]
/var/tmp/portage/dev-util/kbuild-0.1.4/temp/build.log

many lines of
*** %n in writable segment detected ***
stripped
Comment 4 Kamen Dokov 2009-01-30 19:44:01 UTC
(In reply to comment #0)
> When emerging dev-util/kbuild-0.1.4, my box is starting to swap massively and
> is hardly responsive. ps and top show that cvs is running as a child process
> and is eating up all memory. After a while stdout is being flooded with
> 
> *** %n in writable segment detected ***
> 
> 

Confirmed it just ate my 8G of ram :(
I`m on ~amd64 too  !
Comment 5 Martin Walch 2009-01-30 20:16:45 UTC
This seems to come from dev-util/cvs-1.12.12-r4 being compiled with sys-devel/gcc-4.3.3, because:

dev-util/kbuild-0.1.4 pulls in as dependencies dev-util/cvs-1.12.12-r4 and sys-devel/gettext-0.17

compiling all three with gcc 4.3.2-r3 works fine
only gettext with 4.3.3 works fine
only gettext and kbuild with 4.3.3 works fine
compiling all three with 4.3.3 leads to the above error

So this is probably something about porting cvs to gcc-4.3.3.

I will look for suspicious compiler output in cvs.
Comment 6 Martin Walch 2009-01-31 16:57:28 UTC
Created attachment 180438 [details]
output on stdout from emerging cvs with gcc 4.3.2-r3
Comment 7 Martin Walch 2009-01-31 16:58:59 UTC
Created attachment 180441 [details]
output on stdout from emerging cvs with gcc 4.3.3
Comment 8 Martin Walch 2009-01-31 17:04:43 UTC
Created attachment 180443 [details]
diff -u emerge_cvs_gcc_4.3.2-r3 emerge_cvs_gcc_4.3.3

There are indeed quite some new warnings:

diff3.c:1506: warning: format not a string literal and no format arguments
util.c:238: warning: missing sentinel in function call
util.c:338: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
filesubr.c:47: warning: ignoring return value of 'symlink', declared with attribute warn_unused_result
ls.c:549: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result
main.c:1378: warning: format not a string literal and no format arguments
parseinfo.c:253: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'size_t'
rcs.c:826: warning: ignoring return value of 'strtoul', declared with attribute warn_unused_resuupdate.c:1062: warning: ignoring return value of 'chdir', declared with attribute warn_unused_resultlt
subr.c:1340: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

see this file for more details, or the two diffed files for complete output
Comment 9 Andrey Vihrov 2009-01-31 18:40:54 UTC
Confirmed here on ~amd64.

emerge --info:
Portage 2.1.6.7 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.8_p20080602-r1, 2.6.27-gentoo-r8 x86_64)
=================================================================
System uname: Linux-2.6.27-gentoo-r8-x86_64-with-glibc2.2.5
Timestamp of tree: Sat, 31 Jan 2009 14:00:01 +0000
app-shells/bash:     3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.5.4-r2
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    1.3.3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CPPFLAGS="-DNDEBUG"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.tups.lv/source/"
LANG="ru_RU.UTF-8"
LC_ALL="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="ru en lv"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --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="X acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode evo fam firefox fortran gdbm gif gnome gpm gstreamer gtk iconv isdnlog jpeg libnotify mad midi mikmod mmx mmxext mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support quicktime readline reflection sdl session spell spl sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg symlink sysfs tcpd tiff truetype unicode usb vorbis xml xorg xulrunner xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en lv" USERLAND="GNU" VIDEO_CARDS="intel"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 10 Magnus Granberg gentoo-dev 2009-01-31 20:56:08 UTC
Tray to disable fortify_source or -Wformat-security
New thing in gcc 4.3.3

Comment 11 Martin Walch 2009-02-01 00:28:57 UTC
(In reply to comment #10)
> Tray to disable fortify_source or -Wformat-security
> New thing in gcc 4.3.3
> 

-Wno-format-security did not help, but setting -D_FORTIFY_SOURCE=1 (default seems to be -D_FORTIFY_SOURCE=2) for cvs worked fine.
Comment 12 Guillermo Antonio Amaral Bastidas 2009-02-01 05:47:25 UTC
Confirmed and working if I use -D_FORTIFY_SOURCE=1 in CVS

Portage 2.2_rc23 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.28-gentoo-r1-daedalus i686)
Comment 13 Martin Walch 2009-02-01 18:19:38 UTC
If I do not get it wrong this is basically a duplicate of #218567 (or #230849, which has been marked as dup of #218567). Patrick Lauer added a patch for #218567 today.
Comment 14 Martin Walch 2009-12-12 18:21:22 UTC
dev-util/cvs-1.12.12-r6 has been stable on all arches for quite a while, which should have fixed this issue. For details look at bug #218567.

Closing this bug as it seems to be fixed. If anyone is still experiencing this problem, it is probably better to create a new bug report.