Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 151632 - gcc4 breaks sudo?
Summary: gcc4 breaks sudo?
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On: 151893
Blocks: FC4Blocker
TreeView+ depends on / blocked
 
Reported: 2005-03-21 08:29 UTC by Robert Scheck
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version: 4.0.0-0.36
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-25 07:40:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 20601 0 None None None Never

Description Robert Scheck 2005-03-21 08:29:35 UTC
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"
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"
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):
at-3.1.8-66

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 
standards.

Comment 1 Robert Scheck 2005-03-21 08:35:26 UTC
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 09:13:36 UTC
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 13:30:30 UTC
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 06:44:03 UTC
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
important.

Comment 5 Robert Scheck 2005-03-23 08:16:27 UTC
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 11:35:17 UTC
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 07:40:10 UTC
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.