Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 225341 - netkit-rsh failure w/ glibc-2.8 (ARG_MAX undeclared)
Summary: netkit-rsh failure w/ glibc-2.8 (ARG_MAX undeclared)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
: 225411 226471 226681 (view as bug list)
Depends on:
Blocks: glibc-2.8
  Show dependency tree
Reported: 2008-06-08 12:18 UTC by Tobias Scherbaum (RETIRED)
Modified: 2008-06-16 21:08 UTC (History)
23 users (show)

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

overlay ebuild (netkit-rsh-0.17-r9.ebuild,1.90 KB, text/plain)
2008-06-13 17:56 UTC, Tom-Steve Watzke
patch fixing this bug (netkit-rsh-0.17-arg_max.patch,2.05 KB, patch)
2008-06-13 17:59 UTC, Tom-Steve Watzke
Details | Diff
folder including updated ebuild, patch and manifest ready for an overlay (net-misc.tar.gz,4.33 KB, text/plain)
2008-06-15 14:29 UTC, Billy DeVincentis

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Scherbaum (RETIRED) gentoo-dev 2008-06-08 12:18:20 UTC
Fails with gcc-4.3

rexecd.c: In function 'PAM_conv':
rexecd.c:197: warning: ignoring return value of 'realloc', declared with attribute warn_unused_result
rexecd.c:186: warning: unused parameter 'appdata_ptr'
rexecd.c: In function 'doit':
rexecd.c:236: error: 'ARG_MAX' undeclared (first use in this function)
rexecd.c:236: error: (Each undeclared identifier is reported only once
rexecd.c:236: error: for each function it appears in.)
rexecd.c:442: warning: missing sentinel in function call
rexecd.c:236: warning: unused variable 'cmdbuf'
make[1]: *** [rexecd.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/net-misc/netkit-rsh-0.17-r9/work/netkit-rsh-0.17/rexecd'
make: *** [] Error 2
x86_64-pc-linux-gnu-gcc -O2 -O2 -pipe -Wall -W  -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  ruserpass.c -c
make: *** Waiting for unfinished jobs....
ruserpass.c:81: warning: no previous prototype for 'xruserpass'
rexec.c: In function 'main':
rexec.c:221: warning: comparison between signed and unsigned
x86_64-pc-linux-gnu-gcc  rexec.o ruserpass.o -lcrypt -lutil -lutil -o rexec
make[1]: Leaving directory `/var/tmp/portage/net-misc/netkit-rsh-0.17-r9/work/netkit-rsh-0.17/rexec'
x86_64-pc-linux-gnu-gcc  rcp.o -lcrypt -lutil -lutil -o rcp
make[1]: Leaving directory `/var/tmp/portage/net-misc/netkit-rsh-0.17-r9/work/netkit-rsh-0.17/rcp'
 * ERROR: net-misc/netkit-rsh-0.17-r9 failed.
 * Call stack:
 *     , line   49:  Called src_compile
 *             environment, line 2244:  Called die
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2008-06-08 12:34:32 UTC
This is fedora 440867:
Snatch patch from here:
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2008-06-08 19:13:30 UTC
*** Bug 225411 has been marked as a duplicate of this bug. ***
Comment 3 Kevin Bowling 2008-06-10 07:10:22 UTC
Need to change
        char user[17], pass[17];


        char user[16], pass[16];

to apply with Gentoo.
Comment 4 Boney McCracker 2008-06-13 02:39:21 UTC
patch works for me

Comment 5 ~S 2008-06-13 14:08:28 UTC
(In reply to comment #3)
> Need to change
>         char user[17], pass[17];
> to
>         char user[16], pass[16];
> to apply with Gentoo.

well I had stable system working, updated glibc and gcc both
and then thought of doing emerge -e world (silly me, wanted to check for bugs)
and so i ran into this netkit-rsh bug
googled and read about the bug, but i am can't do anything but use emerge commands
so please mention here when a newer version gets into the portage
so that i can sync and use it

as for  Kevin Bowling  's reply 
i checked 
and found that

static void
doit(struct sockaddr_in *fromp)
        char cmdbuf[ARG_MAX+1];
        char user[16], pass[16];
        struct passwd *pwd;
        int s = -1;
        u_short port;

so looks like its already user[16] and pass[16] there
so i am not sure if this is gonna help
@fedora patch
can you point me to URL's or howto's to help me with patching and compiling it?

all i want in the end is to get 0 return value from emerge -e world :D

PS: i dunno if its gonna help or not but here's my emerge --info

Portage (default-linux/amd64/2007.0, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.25-gentoo-r4 x86_64)
System uname: 2.6.25-gentoo-r4 x86_64 Intel(R) Core(TM)2 CPU 6420 @ 2.13GHz
Timestamp of tree: Thu, 12 Jun 2008 22:45:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.4
virtual/os-headers:  2.6.25-r4
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=nocona -O2 -pipe"
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/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
FEATURES="ccachei distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac aalib acl alsa amarok amd64 apache2 asf bash-completion berkdb bzip2 cairo cd cdr chroot cli cracklib crypt cups dbus dri dts dv dvd dvdr dvdread encode exif ffmpeg flac fortran ftp ggi gif glitz gphoto2 gpm gtk gtk2 hal iconv ieee1394 imagemagick imap imlib ipod isdnlog jabber java javascript jbig jpeg jpeg2k kde lm_sensors mad matroska matrox midi mime mmx mmxext mng mozilla mp2 mp3 mp4 mpeg mplayer mudflap musicbrainz mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf perl php plotutils png pppd python qt3 qt4 quicktime rar rdesktop readline reflection ruby session smp socks speex spell spl srt sse sse2 ssl svg tcpd tetex theora threads tiff truetype unicode usb utempter vcd videos vim-syntax vlm vorbis wavpack wmf wxwindows x264 xface xine xml xorg xpm xscreensaver xv xvid xvmc 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 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="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nvidia"

NOTE:- I use local repos from my university ftp server, which lags the main repo by a day or two usually. So just a mention here on the bugzilla about the fix would be enough. Thanks
Comment 6 Ferenc Erki 2008-06-13 16:01:28 UTC
Fedora's patch nicely works for me too!:)

~S: there is a nice HOWTO on patching ebuilds at
Comment 7 Tom-Steve Watzke 2008-06-13 17:56:45 UTC
Created attachment 156649 [details]
overlay ebuild

Assuming your portage overlay dir is: /usr/local/portage  .... do as follows:
mkdir /usr/local/portage/net-misc
mkdir /usr/local/portage/net-misc/netkit-rsh
cd /usr/local/portage/net-misc/netkit-rsh
mkdir files
cp /usr/portage/net-misc/netkit-rsh/files/* ./files/

Download ebuild put it in directory: /usr/local/portage/net-misc/netkit-rsh
---> to be continued by downloading patch ...
Comment 8 Tom-Steve Watzke 2008-06-13 17:59:31 UTC
Created attachment 156651 [details, diff]
patch fixing this bug

Download this patch, put it in: /usr/local/portage/net-misc/netkit-rsh/files
Create Manifest:
ebuild /usr/local/portage/net-misc/netkit-rsh/netkit-rsh-0.17-r9.ebuild digest

Finally emerge it.

NOTE: I looked in Fedora patch, which was not applied on my emerge. I made nearly the same fixes (some code is diffrent).
Comment 9 Kevin Bowling 2008-06-13 20:02:03 UTC
~S - use emerge --resume --skip-first for any failures if you don't feel comfortable patching.  When the patches hit portage, come back and reemerge the skipped packages.

The 17->16 change is in the patch, not the actual file.
Comment 10 Tom-Steve Watzke 2008-06-13 23:59:35 UTC
Sure waiting for patches hitting portage is better.
Anyway, not if you are installing gentoo, and have to wait for updates. *g*
Comment 11 ~S 2008-06-14 04:49:36 UTC
thanks a lot guys!
I seem to like this bugzilla thingy which seems to be filled with helpful people :)
as I said I was doing emerge -e world
so I used --skipfirst for the time being
and now i have plenty of packages that refuse to build (netkit rsh, tunepimp etc.)
but thanks for your help
i will create my local overlay and patch them myself (if i find those patch in the first place)

*g* this is geeky
thanks again

The 17->16 change is in the patch, not the actual file.
so I have the patch but it still fails because of the stupid gcc? or are these two totally different bugs/patches?

Thanks a lot for the short howto on overlays, just made myself a local overlay
and waiting for the emerge -e world -skipfirst to finish.
Just one question, when portage updates and the patch is in portage, how do i remove this overlay and use official patch?

thanks for the link, goes straight into my bookmarks

Comment 12 Peter Alfredsen (RETIRED) gentoo-dev 2008-06-14 04:50:18 UTC
*** Bug 226471 has been marked as a duplicate of this bug. ***
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-06-14 09:07:09 UTC
Hrm, I'm not sure about this, does it work with glibc _before_ 2.8?
Comment 14 Tom-Steve Watzke 2008-06-14 10:53:18 UTC
You don't need to delete the overlay directory, maybe you need it later.
F.e. I use it for the package gnome to make epiphany optional (with USE flag).
You also can look for other ebuilds or portage overlays, there are packages, which are not in portage.

If you want to clean the "old" netkit-rsh (when the new patch hits portage), do:
rm -r /usr/local/portage/net-misc

To the bug:
glibc-2.8 does no longer include the makro (global definition) "ARG_MAX",
it must be replaced by: sysconf (_SC_ARG_MAX). 

The developer will include the following to their files (or the files will be patched):
#if defined(_SC_ARG_MAX)
# if defined(ARG_MAX)
#    undef ARG_MAX
# endif
# define ARG_MAX sysconf (_SC_ARG_MAX)

This ensures that both variants work, before and after glibc-2.8.
As you notice in the patch, it is a workaround for glibc-2.8 and above,
"ARG_MAX" is replaced with "sysconf (_SC_ARG_MAX)". 
(I noticed it, when other packages also failed)
Comment 15 Billy DeVincentis 2008-06-15 03:27:03 UTC
Same problem here, please fix and commit to tree!!
Comment 16 Ryan Hill (RETIRED) gentoo-dev 2008-06-15 04:10:32 UTC
*** Bug 226681 has been marked as a duplicate of this bug. ***
Comment 17 Billy DeVincentis 2008-06-15 14:10:54 UTC
This worked for me on amd64.
Comment 18 Billy DeVincentis 2008-06-15 14:29:54 UTC
Created attachment 156917 [details]
folder including updated ebuild, patch and manifest ready for an overlay
Comment 19 Bob Raitz 2008-06-16 07:42:42 UTC
(In reply to comment #18)
> Created an attachment (id=156917) [edit]
> folder including updated ebuild, patch and manifest ready for an overlay

This is awesome! I just got it to compile on two out of three systems. I'm going to set it up on the third so it gets picked up when I do an emerge -aev world

Thanks for that.

Blessed be!
Comment 20 Flo Gravo 2008-06-16 08:57:21 UTC
Patched overlay worked for me too.
Comment 21 Craig Goodrich 2008-06-16 15:02:38 UTC
Same problem here; please get the patch into the portage tree ASAP, since it is a showstopper updating Gnome.

Just as a kvetch -- grepping /usr/include I find all sorts of games being played with ARG_MAX and variations (_POSIX_ARG_MAX etc.) -- why isn't ARG_MAX simply defined correctly ("sysconf (_SC_ARG_MAX)") somewhere in the forest of headers, rather than in the source for individual applications?  Is the UNIX source code situation getting out of control?  Is backwards compatibility not a consideration for the glibc developers?
Comment 22 SpanKY gentoo-dev 2008-06-16 21:08:56 UTC
i doubt anything in gnome explicitly depends on rsh ... it is also trivial to workaround

fixed in cvs