Bug 151632 - gcc4 breaks sudo?
gcc4 breaks sudo?
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Ben Levenson
Depends On: 151893
Blocks: FC4Blocker
  Show dependency treegraph
Reported: 2005-03-21 03:29 EST by Robert Scheck
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 4.0.0-0.36
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-25 02:40:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 20601 None None None Never

  None (edit)
Description Robert Scheck 2005-03-21 03:29:35 EST
Description of problem:
at-3.1.8-60 out of RHEL4 does the following, which is - I would say - okay:
[root@rhel4 ~]# sudo -u root echo "foo"
[root@rhel4 ~]#

at-3.1.8-66 out of Fedora Core development does this, which isn't okay:
[root@devel ~]# sudo -u root echo "foo"
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
            [-u username/#uid] [-r role] [-t type] -s | <command>
[root@devel ~]# 

Ehm...okay, there's a pipe before <command>, but why do I also get here the 
usage information?
[root@devel ~]# sudo -u root | echo "foo"
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
            [-u username/#uid] [-r role] [-t type] -s | <command>
[root@devel ~]# 

Version-Release number of selected component (if applicable):

How reproducible:
Everytime, see above.

Actual results:
at has a strange behaviour

Expected results:
"Normal" behaviour or better documentation or whatelse to match with the 
Comment 1 Robert Scheck 2005-03-21 03:35:26 EST
Oh shit, this should be applied to sudo rather at. BIG SORRY!! The problem is 
sudo-1.6.7p5-30.1 (RHEL4) vs. sudo-1.6.7p5-31 (Fedora Core Development)...
re-assigning ;-)
Comment 2 Robert Scheck 2005-03-21 04:13:36 EST
Oh dear (it's too early at Monday), the problem is such simple:

[root@devel ~]# sudo -u nobody id
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
            [-u username/#uid] [-r role] [-t type] -s | <command>
[root@devel ~]# 

[root@rhel4 ~]# sudo -u nobody id
uid=99(nobody) gid=99(nobody) groups=99(nobody)
[root@rhel4 ~]#

Something went simply wrong at sudo, completely wrong behaviour!
Comment 3 Robert Scheck 2005-03-21 08:30:30 EST
Ha, and this problem is caused by gcc4! If I rebuild sudo using gcc32 (compat-
package), rebuilding works and sudo also -- as expected! Fixup for gcc4, 
please... ;-)
Comment 4 Jakub Jelinek 2005-03-23 01:44:03 EST
The fact that it works when rebuilt with gcc32 does not mean it is not a bug
in sudo.
But more importantly, you haven't specified the architecture, which is quite
Comment 5 Robert Scheck 2005-03-23 03:16:27 EST
Well, I would say anyway, the problem is sudo, because:

Take a vanilla sudo-1.6.7p5, run ./configure && make && ./sudo -u nobody id
=> Fails with the error already written above

Take a vanilla sudo-1.6.8p7, run ./configure && make && ./sudo -u nobody id
=> Works fine: uid=99(nobody) gid=99(nobody) groups=99(nobody)

But to make you, Jakub, happy: it's an i686 (Intel(R) Xeon(TM) CPU 3.06GHz) 
using gcc-Version 4.0.0 20050314 (Red Hat 4.0.0-0.34) and glibc-2.3.4-16.
Comment 6 Jakub Jelinek 2005-03-23 06:35:17 EST
Ok, this indeed looks like a GCC bug.
As a workaround, you might prevent parse_args from being inlined
(either __attribute__((noinline)), or by removing static from it).
Comment 7 Jakub Jelinek 2005-03-25 02:40:10 EST
Should be fixed in gcc-4.0.0-0.36.

Note You need to log in before you can comment on or make changes to this bug.